fix(codex): retain worktree context across turns - #260
Both prior findings are resolved. The new test code replaces real-git shelling w
Both prior findings are resolved. The new test code replaces real-git shelling with a WorktreeRegistry::Static test seam and covers all rejection branches of is_registered_worktree/capture_worktree: forged command name, non-zero exit code, unregistered path, and branch mismatch. The positive path test asserts both the workspace-context callback payload and the emitted SESSION_INFO semantic event. All assertions are behavioural — each test would fail if the corresponding guard in capture_worktree regressed. No new blocking concerns. (2 earlier finding(s) still open) Code retrieval was unavailable (model: openrouter embeddings returned 404 Not Found: {"error":{"message":"No allowed providers are available for the selected model. Providers serving openai/text-embedding-3-small: openai, azure, but your account's allowed-providers setting permits only: deepinfra, streamlake, digitalocean. To change your allowed providers, visit: https://openrouter.ai/settings/privacy.","code":404,"metadata":{"available_providers":["openai","azure"],"requested_pro), so this review saw the diff alone.
No findings.
Fixed since the last review
- Do not shell out to real git in unit tests — fixed: tests now use
FoldState::with_registered_worktreeswithWorktreeRegistry::Static, no real git subprocess. - Exercise the is_registered_worktree rejection path — fixed: four new tests cover the forged-report, failed-exit, unregistered-path, and branch-mismatch rejection branches.