Skip to content

fix(runtime): resolve workbench Git outside the scanned repository - #487

Open
mldangelo-oai wants to merge 1 commit into
mainfrom
mdangelo/codex/trusted-workbench-git-20260816
Open

fix(runtime): resolve workbench Git outside the scanned repository#487
mldangelo-oai wants to merge 1 commit into
mainfrom
mdangelo/codex/trusted-workbench-git-20260816

Conversation

@mldangelo-oai

Copy link
Copy Markdown
Collaborator

Summary

Resolve workbench Git outside the scanned repository and invoke the selected executable directly.

Changes

  • Pass the selected repository root into workbench subprocess configuration.
  • Reuse the existing trusted-executable resolver and pass its selected Git path directly to the bundled workbench.
  • Preserve existing Python interpreter selection, trusted launcher helpers, and Git-optional operation.

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, and node --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

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

Copy link
Copy Markdown
Collaborator Author

@codex review

@github-actions github-actions Bot added the bug Something isn't working label Aug 16, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

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".

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 6c77d54424

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@mldangelo-oai
mldangelo-oai marked this pull request as ready for review August 16, 2026 15:23

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread sdk/typescript/src/api.ts
const workbenchOptions: WorkbenchCommandOptions = {
python,
pluginRoot: runtime.plugin.pluginRoot,
protectedRoot,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant