Skip to content

fix(diagnostics): preserve saved-scan errors and recovery advice - #1266

Merged
mldangelo-oai merged 145 commits into
mainfrom
mdangelo/codex/cli-diagnostics
Nov 5, 2026
Merged

mldangelo-oai merged 145 commits into
mainfrom
mdangelo/codex/cli-diagnostics

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Preserve original failure details and give relevant recovery advice for saved scans. Explicit policy refusals stop review attempts, while operational failures retain their error behavior. Canceled interactive patch review keeps saved results and reports an unsuccessful full-output envelope.

Changes

  • Preserve diagnostic text across CLI, SDK, workbench transport, and saved state, including terminal-control escaping. Compare checked scan-file identities without numeric precision loss.
  • Keep structured transport failures and leading service failures operational, with existing retry rules. Explicit policy codes and request/review refusals remain authoritative; artifact-upload errors mentioning policy do not become refusals.
  • Retain authentication, model-access, and rate-limit advice for explicit service statuses and named-model failures. Explicit camel-case and underscore response-status fields retain service advice; similarly named path tokens and field suffixes do not gain it. Local SQLite, database, and workbench timeout or quoted-model-not-found messages retain their original diagnosis without unrelated model-service advice; service failures and URL components keep their existing handling.
  • Report ok: false and the existing error in TOON/YAML --full-output when patch review is canceled or a failure retains scan results. Preserve rendered data and metadata, exact diagnostic newlines, exit status 130 for cancellation, default output silence, and existing output controls. JSON/JSONL remain noninteractive. Scan, resume, and rerun execution failures load available sealed results for YAML and TOON full-output, including default TOON; invalid saved data retains the original error.

Testing

Local validation at 14037d0e517407e8c0cc3e4957d45fd94fe844e8, including main at fe9d77e1c3d973b00209487cc9dd30e42886654e, passed:

  • 703 selected diagnostic, endpoint, and refusal tests, plus 219 saved-result and output tests; 3,208 assertions and no failures.
  • SDK/MCP type checks, full SDK formatting, and git diff --check.

The new real subprocess cases reproduce nine local quoted-model advice failures and nine YAML/TOON retained-result failures before their respective fixes. The final checks preserve genuine model-service advice, JSON/JSONL results, no-full-output behavior, invalid-contract errors, cancellation, and output controls.

These Linux checks used Node 22.23.3, Bun 1.3.14, and seed 12345. The main merge changes only the two Dockerfile base-image references to Node 26.12.1; container images were not built. Full seeded and unseeded SDK package runs and fresh exact-head hosted CI remain pending; these results do not establish cross-platform or merge readiness.

Risk and rollout

No new commands, flags, environment variables, or defaults. Original diagnostic text remains available, with existing terminal, credential, configuration, path, and scan-integrity protections. Workbench state failures retain their existing error behavior; publication transport failures do not gain automatic retries.

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.

@github-actions github-actions Bot added the bug Something isn't working label Oct 5, 2026
@mldangelo-oai
mldangelo-oai marked this pull request as ready for review October 5, 2026 14:52
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 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-11-05T00:54:34.640897Z 7d3f808 Manual request
🔒 Security Review ✅ Completed 2026-11-05T00:55:40.086274Z 7d3f808 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.

@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: afd99eabc5

ℹ️ 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/cli.ts Resolved
Comment thread sdk/typescript/src/runtime.ts Resolved

@alandelong-oai alandelong-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the full contribution at d7790b39e85307d6203f005fdde5605e3dbd34d8 with selected base 1345ea3fa48021ef54ecc2dcc948fde43fec8d0c, including changed tests and touched context, using three independent reviews followed by root synthesis.

The following P2 issues remain in this captured contribution:

  • sdk/typescript/src/runtime.ts line 2901 (existing thread): The new timeout branch throws plain Error before the existing SandboxUnavailableError construction. Callers recognizing sandbox preflight failures by the exported class now miss timeouts alone. Preserve that error type while adding the timeout detail/cause.
  • sdk/typescript/src/deduplication/refusal.ts (existing thread): Removing both bidirectional patterns stops recognizing 'This request was refused under the safety policy'. Neither the remaining policy-first pattern nor first-person pattern matches it. Preserve narrowly scoped explicit reversed-order refusals while excluding operational prose. This is confirmed at the classifier itself; downstream behavior outside touched files was not independently inspected.

Static source review; tests were inspected but not executed. CI, mergeability and integration are separate.

@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: b2ac55c17b

ℹ️ 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/bin/codex-security.mjs Resolved

@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: 344103c507

ℹ️ 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 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: e2d6688716

ℹ️ 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/cli.ts Resolved
Comment thread sdk/typescript/src/auth.ts Resolved

@alandelong-oai alandelong-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the complete contribution and changed tests with three independent review passes plus root synthesis. No supported introduced finding remains at this head. This is a static source review; tests were not executed, and CI and integration remain separate.

@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: e1f9c90039

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

@alandelong-oai alandelong-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The six issues in the previous review remain in unchanged diagnostic code. The incoming fixture refactor preserves the dash-prefixed query and note checks; no duplicate inline comments.

Current builds, types, formatting and portable checks pass. The MCP smoke fixture stops at an existing output-directory ownership check before those assertions. Earlier feature reproductions transfer through source comparisons with their original limits; no full feature or platform run is claimed.

Copy link
Copy Markdown
Collaborator Author

@codex review

Please recheck how CLI diagnostics distinguish local paths, parser failures and provider errors, and how finding-issue inspection reports inaccessible local history. The SDK diagnostic tests, MCP inspection test and finalizer control-character test passed locally.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 8d1e5e8610

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

Copy link
Copy Markdown
Collaborator Author

@codex review

Please recheck head 073c57e, including how an inaccessible finding-issue history preserves the SQLite message for existing callers while supplying a structured error through MCP. Both Python variants of the receipt regression passed.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 073c57efd0

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

Copy link
Copy Markdown
Collaborator Author

@codex review

Please recheck the export test against the actual Python finalizer. It escapes terminal control bytes before sending errors to either the SDK or CLI. Both failing export cases now assert the literal escaped path and pass locally.

Copy link
Copy Markdown
Collaborator Author

@codex review

The Linux and macOS coverage shards both timed out inside the skill-diagnostics suite. Path classification rescanned non-path text at every character. It now inspects each token once and keeps the original error text for display. The existing large UTF-8 child-output regression exceeded 9 seconds on the previous head and finished in 177 ms with the fix. The 547 focused diagnostics tests passed with the CI seed and coverage enabled.

Copy link
Copy Markdown
Collaborator Author

@codex review

Please recheck the path masking change in skill diagnostics. A provider-qualified model name inside quotes is now masked with a neutral token, which keeps the model-not-found advice while preventing path contents from being interpreted as status codes. All 651 skill diagnostic/failure tests pass with CI seed 19088 and coverage enabled.

@alandelong-oai alandelong-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks—the previous subprocess failures are fixed. All 63 maintained child cases and 541 diagnostic cases pass, along with the current build, types, formatting and portable checks. I left one nonblocking quote-handling suggestion; original diagnostics and exit statuses remain intact.

The additional 18-case child matrix isolates that advice gap. Earlier Python and native-build evidence retains its original execution scope; this is focused validation, with no full-suite or cross-platform run claimed.

Comment thread sdk/typescript/src/cli.ts Resolved

Copy link
Copy Markdown
Collaborator Author

@codex review

Please take a final look at 7d3f808. The backtick-qualified model case is now covered for all three commands, and the path classifier retains those delimiters. All 654 focused cases passed.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 7d3f808faf

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

@alandelong-oai alandelong-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for fixing the backtick case. No remaining findings. Both token boundaries now preserve the quotes, and the added subprocess cases cover all three commands.

Current validation passed 66 maintained child cases, 541 diagnostic cases and all 18 additional quote-matrix cases, plus the build, types, formatting and portable checks. Original diagnostics and exit statuses remain intact. Earlier Python and native-build evidence retains its original scope; no full-suite or cross-platform run is claimed.

@mldangelo-oai
mldangelo-oai merged commit 5d65d25 into main Nov 5, 2026
74 checks passed
@mldangelo-oai
mldangelo-oai deleted the mdangelo/codex/cli-diagnostics branch November 5, 2026 01:22
@github-actions github-actions Bot mentioned this pull request Nov 5, 2026
3 tasks done
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.

4 participants