Skip to content

fix: honor the requested output format when rerunning a scan - #203

Open
mariohercules wants to merge 2 commits into
openai:mainfrom
mariohercules:fix/rerun-honors-output-format
Open

fix: honor the requested output format when rerunning a scan#203
mariohercules wants to merge 2 commits into
openai:mainfrom
mariohercules:fix/rerun-honors-output-format

Conversation

@mariohercules

Copy link
Copy Markdown

Fixes #39.

Problem

scans rerun called runScan without forwarding the requested output format, so it always took the interactive = true default. scan computes it from the format:

format !== "json" && format !== "jsonl",

interactive gates the credential-selection prompt and the TTY progress rendering, so scans rerun <id> --json could block on a prompt that scan --json suppresses in exactly the same situation. In an automated context holding a pty, the command waits for input that never arrives.

The same missing plumbing meant scans rerun --format md was accepted, while scan --format md is rejected up front as unsupported for scan results — both commands produce the same scan payload.

Change

Forward the format from the rerun command so both behaviors match scan.

Tests

Two tests, both verified to fail without the change:

  • tests-ts/cli-authentication.test.tsscans rerun --json and --format jsonl never prompt, mirroring the existing "never prompts during automation" guarantee that covered only scan.
  • tests-ts/cli-workbench.test.tsscans rerun --format md exits 2 without starting a scan.

Full suite on this branch: 719 pass, 5 skip, 0 fail. pnpm run types and pnpm run format are clean.

@github-actions github-actions Bot added the bug Something isn't working label Aug 1, 2026
`scans rerun` called `runScan` without forwarding the requested output
format, so it always used the interactive default. With `--json` or
`--format jsonl` it could block on the credential-selection prompt that
`scan` suppresses in the same situation, and it accepted `--format md`,
which `scan` rejects as unsupported for scan results.

Forward the format from the rerun command so both behaviors match `scan`.

Fixes openai#39
@mariohercules
mariohercules force-pushed the fix/rerun-honors-output-format branch from fe85079 to a88e425 Compare August 1, 2026 23:42
@mldangelo-oai

Copy link
Copy Markdown
Collaborator

@codex review exact head 510b925

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 510b925031

ℹ️ 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: 510b925031

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.

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.

scans rerun ignores --json/--format and can block on the interactive credential prompt

2 participants