Skip to content

fix(sdk): preserve canceled scan state - #735

Open
Hughhhhcoder wants to merge 3 commits into
openai:mainfrom
Hughhhhcoder:codex/codex-security-scan-cancel
Open

fix(sdk): preserve canceled scan state#735
Hughhhhcoder wants to merge 3 commits into
openai:mainfrom
Hughhhhcoder:codex/codex-security-scan-cancel

Conversation

@Hughhhhcoder

Copy link
Copy Markdown
Contributor

Summary

Fixes #44. When a caller cancels a registered SDK scan, the scan history is
currently finalized with fail-scan, so an intentional cancellation is stored
as a failure instead of a cancellation.

Changes

  • Route caller- or client-close-induced ScanInterruptedError values through
    cancel-scan.
  • Keep fail-scan for ordinary failures, internal tracking failures, and
    ScanCostLimitExceededError so those errors retain their message and cost
    metadata.
  • Add an orchestration regression that verifies the workbench command and
    arguments for a canceled scan.

Testing

  • bun test --timeout 30000 tests-ts/api.test.ts — 139 passed, 2 skipped, 0 failed.
  • bun test --timeout 30000 tests-ts/scan-recovery.test.ts — 40 passed, 0 failed.
  • pnpm --ignore-workspace run lint — passed.
  • pnpm --ignore-workspace --dir ../../plugins/codex-security/mcp-app run typecheck — passed.
  • pnpm --ignore-workspace run generate:models:check — passed.
  • pnpm --ignore-workspace run format — passed.
  • git diff --check — passed.

Risk and rollout

This changes only the persisted lifecycle command for explicit caller/client
cancellation. Ordinary failures and cost-limit recovery retain the existing
failure path and metadata. No public API or scan input contract changes.

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, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.
@github-actions github-actions Bot added the bug Something isn't working label Aug 29, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T06:35:05.005033Z 3394120 Manual request
🔒 Security Review Completed 2026-08-31T06:34:04.998726Z 3394120 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Hughhhhcoder

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 53a8c9f052

ℹ️ 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 Outdated
@Hughhhhcoder

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 67afadc3ba

ℹ️ 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
@Hughhhhcoder

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 3394120d06

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

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

Labels

bug Something isn't working

1 participant