fix(codex): retain worktree context across turns - #260
The incremental commits address both prior findings. Unit tests now use a determ
The incremental commits address both prior findings. Unit tests now use a deterministic in-process WorktreeRegistry::Static instead of shelling out to real git, and four new tests exercise the rejection paths (forged command, failed exit code, unregistered worktree, mismatched branch). The tests are deterministic and offline. No new issues introduced. (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: the new tests use
WorktreeRegistry::Staticviawith_registered_worktreesinstead of shelling out to real git. - Exercise the is_registered_worktree rejection path — fixed: the new tests
forged_worktree_report_does_not_update_the_app_server_workspace,failed_worktree_command_does_not_update_the_app_server_workspace,unregistered_worktree_does_not_update_the_app_server_workspace, andmismatched_worktree_branch_does_not_update_the_app_server_workspacecover the rejection paths.