Skip to content

fix(model-fit): retry transient tool admission locks - #25

Merged
TorinAsakura merged 1 commit into
masterfrom
fix/tool-admission-lock-contention
Dec 1, 2026
Merged

TorinAsakura merged 1 commit into
masterfrom
fix/tool-admission-lock-contention

Conversation

@TorinAsakura

Copy link
Copy Markdown
Member

Task

How to verify

Before the fix

  1. In an isolated CODEX_HOME, stage a passed handoff record for an earlier turn. Hold the thread state lock in a separate process and invoke PreToolUse for pwd in a later turn. Release the lock after the first acquisition attempt. The original handler denies pwd with state_lock_busy.

After the fix

  1. Repeat the same scenario. The initial read retries for up to 50 ms, then the ordinary command is admitted once the lock is acquired and the current state permits it.
  2. Repeat with the lock holder writing a new pending_assessment before releasing the lock. The command is denied with assessment_pending. An unprepared technical queue command is still denied.
  3. Keep the lock held beyond the retry window. The ordinary call from the later turn stays denied, and the message identifies the busy state lock.

Proofs

  • uv run --locked pytest switch/tests/test_tool_admission.py -q from evals/model-fit exercises the cases using a separate process and the real file lock. The regression checks produced four failed assertions before the fix. With the fix, 18 tests and 17 subtests passed
  • yarn test:autoswitch passed 210 tests
  • uv run --locked --no-editable --reinstall-package vector-prime mypy --strict --disallow-any-explicit -p vector_prime passed for 199 source files

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-01T23:14:11.444784Z 19720df PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@TorinAsakura
TorinAsakura merged commit 27370ef into master Dec 1, 2026
3 checks passed
@TorinAsakura
TorinAsakura deleted the fix/tool-admission-lock-contention branch December 1, 2026 23:50
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.

[Bug] False tool admission denials

1 participant