Skip to content

[codex] Fix Codex stop hook index fallback#599

Draft
stevenkleinhens wants to merge 1 commit into
zilliztech:mainfrom
stevenkleinhens:fix/codex-stop-hook-worker-index
Draft

[codex] Fix Codex stop hook index fallback#599
stevenkleinhens wants to merge 1 commit into
zilliztech:mainfrom
stevenkleinhens:fix/codex-stop-hook-worker-index

Conversation

@stevenkleinhens

Copy link
Copy Markdown

Summary

  • Fix the Codex stop hook worker temp-file template so macOS mktemp creates unique files instead of a literal XXXXXX.json path.
  • Avoid full stop-hook reindexing when a watch process is already alive.
  • Add a one-at-a-time background index fallback for cases where no watch is running.

Root cause

The stop hook used a macOS-incompatible mktemp ...XXXXXX.json template and then ran a full memsearch index after each stop-hook memory write. With repeated stop workers, that could overwrite worker payloads and spawn redundant full index processes even though memsearch watch should normally own incremental indexing.

Validation

  • uv run pytest tests/test_codex_stop_hook_worker.py tests/test_codex_stop_hook_utf8.py -q
  • uv run ruff check tests/test_codex_stop_hook_worker.py
  • bash -n plugins/codex/hooks/common.sh plugins/codex/hooks/stop.sh
  • git diff --check

Note: a full uv run pytest -q reached 199 passed, 7 skipped before I interrupted a Milvus Lite reopen test that was retrying a refused local socket; that appears unrelated to this hook change.

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