fix(runtime): resolve workbench Git outside the scanned repository - #487
fix(runtime): resolve workbench Git outside the scanned repository#487mldangelo-oai wants to merge 1 commit into
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6c77d54424
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const workbenchOptions: WorkbenchCommandOptions = { | ||
| python, | ||
| pluginRoot: runtime.plugin.pluginRoot, | ||
| protectedRoot, |
There was a problem hiding this comment.
Propagate trusted Git to scan helper processes
When a diff scan is launched with a repository-local directory such as node_modules/.bin on PATH, protectedRoot sanitizes Git only for SDK-owned runWorkbench calls. The Codex thread environment built later in api.ts does not receive the selected executable or sanitized path, while security-diff-scan/SKILL.md invokes generate_in_scope_files.py and generate_rank_input.py, which still execute bare git commands. A repository-controlled shim can therefore run during discovery and falsify the changed-file inventory despite this fix; apply the trusted Git selection to those helper processes as well.
AGENTS.md reference: sdk/typescript/AGENTS.md:L19-L20
Useful? React with 👍 / 👎.
Summary
Resolve workbench Git outside the scanned repository and invoke the selected executable directly.
Changes
Testing
bun test --timeout 30000 tests-ts/runtime.test.ts tests-ts/trusted-executable.test.ts tests-ts/cli-export.test.ts tests-ts/cli-workbench.test.ts— 165 passed, 8 expected platform skips, 0 failed.node scripts/generate-models.cjs --check,node --run lint, andnode --run format— passed on this branch.node_modules/.bin/tsc --noEmit— passed on the combined current-main checkout.bun test --timeout 90000 --randomize --seed 12345— combined current-main checkout: 1,301 passed, 11 expected platform skips, 0 failed.git diff --check— passed.Risk and rollout
Only workbench subprocesses with an explicitly supplied repository root receive repository-aware Git selection. Existing Python interpreter selection and trusted launcher helpers remain unchanged. An explicit unavailable-Git marker prevents accidental current-directory executable lookup.
Public disclosure review