feat(cli): add interactive finding review, patching, and optional PRs - #461
Conversation
6ab52c3 to
93e9967
Compare
mldangelo-oai
left a comment
There was a problem hiding this comment.
Non-blocking QA notes on draft 93e99673. The saved-finding patch flow, selection and cancellation UI, and successful local Git publication path worked with synthetic fixtures. The full local suite passed 1,316 tests with 11 skipped. Git used a local remote, and PR creation used a test double, so this was not a live GitHub PR test.
I'd split the work at the patch result: return one structured result for saved findings, literal issues, and Linear input, then let a separate publication step consume it. The saved-finding-only --create-pr path does not yet join up with #475 and #477.
Two concrete Windows follow-ups: use platform-resolved paths in the new tests, and add *.tsx text eol=lf to .gitattributes. The new TUI file passes formatting with LF and fails with CRLF. The current Windows checks still fail. I left the recovery and simplification suggestions inline.
93e9967 to
648adac
Compare
648adac to
21a792c
Compare
21a792c to
e616944
Compare
Summary
After a security scan finishes, choose which findings to fix, generate and check the fixes, and optionally open a GitHub pull request. The same flow also works without prompts and with findings from earlier scans.
Each selected finding runs in its own saved Codex task, which appears in the Codex desktop app.
Changes
Review findings after a scan
npx @openai/codex-security scan .The scan prints its usual findings, then asks whether to review and patch them. Scans with no findings do not ask.
Choose a severity, select individual findings, inspect the surrounding code, and give the patch instructions for each finding:
After you press
Enter, each selected finding gets its own saved Codex task in the desktop app. Each task runs the bundledcodex-security:fix-findingskill with that finding and its instructions. Tasks run one at a time in the same checkout, and a failed finding does not stop the remaining tasks. The scan has already validated its findings, so patching does not run a separate validation command. A fix is accepted only when the task reports how it verified the change.Patch automatically
Patch findings from an earlier scan
Open a pull request after verified fixes
npx @openai/codex-security scan . --patch --patch-severity high --create-pr npx @openai/codex-security patch --scan latest --severity high --create-prOnly verified fixes are committed. Existing staged changes are left alone. The existing Linear issue and project patch commands still work; automatic pull request creation applies to saved scan findings.
Retry a failed push or pull request
If publication fails, run the command printed by the CLI from the same repository:
This reuses the saved commit without running Codex again. It refuses to publish a changed branch and returns the existing PR if one was already created.
Testing
pnpm run typespnpm run formatpnpm run buildpnpm run check:package ../../dist/openai-codex-security-0.1.14.tgzRisk and rollout
Patching and pull request creation are optional. Incomplete scans are not patched. Saved Codex tasks can contain finding details. Code shown in the review stays inside the scanned repository. Existing Linear patching, authentication, project trust, and failure behavior are preserved. Saved findings and Linear issues cannot be mixed in the same patch command.
Public disclosure review