Skip to content

feat(search): re-index on proxy embedding model change#233

Merged
samcm merged 2 commits into
masterfrom
worktree-search-reindex-on-model-change
Jun 18, 2026
Merged

feat(search): re-index on proxy embedding model change#233
samcm merged 2 commits into
masterfrom
worktree-search-reindex-on-model-change

Conversation

@samcm

@samcm samcm commented Jun 18, 2026

Copy link
Copy Markdown
Member

Adds re-index-on-model-change to the search runtime: a background poll detects when the proxy's served embedding model changes and rebuilds the whole corpus under the new model, parking every index not-ready first (atomic-swap wrappers for runbook/EIP/specs, matching the existing example wrapper) so no search ever dot-products a new-model query against an old-model index — a brief reindexing window, never mixed spaces. This delivers the "swap the model via panda-proxy config and clients self-heal" guarantee that the v2 cutover (#232) shipped without; until now a model swap would silently corrupt search on running 0.35.0 servers until restart.

A background poll now detects when the proxy's served embedding model
changes and re-indexes the whole corpus under the new model: it parks
every index not-ready first (via atomic-swap wrappers) so no search
dot-products a new-model query against an old-model index, rebuilds from
the retained registries, then swaps the fresh indices in. Delivers the
'update the model in panda-proxy and clients self-heal' guarantee — a
swap would otherwise silently mix embedding spaces on running servers
until restart. Follow-up to the v2 embedding cutover (#232).
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

🐼 Smoke eval — e274cab: ✅ 6/6 pass

📊 Interactive report — tokens p50 14,133 · tokens/solve 14,072.

Reference points: master@1671f0b 100% · v0.35.0 100% · worktree-search-reindex-on-model-change@a0a5804 100%.

question result tokens tools
forky_node_coverage 12,799 4
tracoor_node_coverage 13,763 6
mainnet_block_arrival_p50 15,467 9
list_datasources 12,301 2
block_count_24h 15,597 10
missed_slots_24h 14,503 6
🔭 Langfuse traces (6 runs; ⚠️ = failed)

The report walks this branch's commits against the master baseline and the most recent release. A self-contained copy is in the run's eval-smoke-* artifact.

reindex advanced builtModel unconditionally, so if any single index
rebuild failed (e.g. a transient proxy timeout) that index stayed parked
not-ready forever — the model-change guard was satisfied, so the next
tick never re-entered reindex. Now builtModel only advances on full
success; a partial failure leaves the guard unsatisfied so the next tick
retries, and the failed index stays not-ready (never mixed) until it
rebuilds.
@samcm

samcm commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

Fixed in e274cab. You're right — reindex advanced builtModel unconditionally, so a single failed rebuild (e.g. transient proxy timeout) left that index parked not-ready forever because the model-change guard would never fire again. Now builtModel/embedder only advance on full success; on any partial failure it leaves the guard unsatisfied and returns, so the next 5-minute tick re-detects the change and retries. The failed index stays not-ready (never mixed) until a retry rebuilds it — bounded retry instead of a permanent dead index.

@samcm samcm merged commit 57f865d into master Jun 18, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant