Skip to content

Add repair-semantic-queue command + post-update bridge for the OV poison loop (#2734)#43

Merged
Kashkovsky merged 1 commit into
mainfrom
feat/repair-semantic-queue-hotfix
Jun 19, 2026
Merged

Add repair-semantic-queue command + post-update bridge for the OV poison loop (#2734)#43
Kashkovsky merged 1 commit into
mainfrom
feat/repair-semantic-queue-hotfix

Conversation

@Kashkovsky

Copy link
Copy Markdown
Owner

Temporary bridge so users stuck on the current pinned OpenViking can drain/avoid the semantic-queue poison loop (#2734) without waiting for the upstream release.

A memory file reindexed with mode=semantic_and_vectors enqueues a directory-level context_type="memory" semantic message; OpenViking's _process_memory_directory lists the file, fails, and the AGFS-persisted message re-enqueues forever — surviving a server restart and stalling reindex --wait / memory writes. threadnote 1.4.1 bounded its own waits (no more 31-min hang), but couldn't clear the cause.

New command threadnote repair-semantic-queue [--apply]:

  • Patches the installed OpenViking semantic_processor.py to skip non-directory/missing memory URIs (the upstream #2735 / PR volcengine/OpenViking#2735 guard), then restarts the server so a stuck message drains on the next dequeue.
  • Idempotent + scoped to "OV unfixed": no-op when a stat(dir_uri) guard (or a prior hot-fix marker) is already present. Keeps a .threadnote-bak, and compile-checks the patched source (python -m py_compile) before writing.
  • Locates the package from the OV server's venv, common uv/pipx roots, or the venv python; override with THREADNOTE_OPENVIKING_SEMANTIC_PROCESSOR.

Post-update migration (introducedIn: 1.4.3): offers the patch on threadnote update with the usual consent prompt (auto-runs only on --yes/interactive-confirm), after ensurePinnedOpenVikingInstalled, so it patches the freshly-installed OV.

Marked for removal: a REMOVE-WHEN note ties this to bumping DEFAULT_OPENVIKING_VERSION to an OpenViking release containing #2735 — at which point the command no-ops and the migration can be dropped. The real fix remains the pin bump + existing upgrade path.

The pure patcher logic is what's tested.

Test plan

  • npm run typecheck, npm run lint, npm test (292 tests / 25 files) green.
  • New semantic_queue_repair.test.ts: patch inserts the guard at the right indent before ls(dir_uri); idempotent (marker → already-fixed); upstream stat(dir_uri) guard → already-fixed; no-anchor when the ls call / method is absent.
  • Validated the built command end-to-end against the real installed OV 0.4.4 (already-fixed path) and a clean copy via the env override (would-patch dry run). The full apply+restart path was validated earlier via the equivalent standalone script on this machine.

…oison loop (#2734)

Temporary bridge until the pinned OpenViking includes upstream PR #2735.

- New `threadnote repair-semantic-queue [--apply]` patches the installed
  OpenViking semantic_processor.py to skip non-directory/missing memory URIs
  (so a memory file reindexed with mode=semantic_and_vectors cannot poison the
  AGFS-persisted semantic queue), then restarts the server so a stuck message
  drains. Idempotent (no-op once OV already has the guard or a prior hot-fix),
  keeps a .threadnote-bak, and compile-checks the patched file before writing.
  Locates the package from the OV server's venv, common uv/pipx roots, or the
  venv python; override with THREADNOTE_OPENVIKING_SEMANTIC_PROCESSOR.
- Post-update migration (introducedIn 1.4.3) offers it on `threadnote update`
  with the usual consent prompt.
- Unit tests for the pure idempotent patcher; troubleshooting doc.

Marked for removal once DEFAULT_OPENVIKING_VERSION is bumped to an OpenViking
release containing PR #2735.
@Kashkovsky Kashkovsky merged commit fac886c into main Jun 19, 2026
6 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