fix(cli): return safe structured scan failure details - #463
fix(cli): return safe structured scan failure details#463mldangelo-oai wants to merge 10 commits into
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
# Conflicts: # sdk/typescript/src/cli.ts
|
@codex review Please review the current head, |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
zcrab-oai
left a comment
There was a problem hiding this comment.
Draft feedback: the CLI classification change should not break the public SDK error contract.
| return await resolveLocalPluginPath(pluginPath, workspace, signal); | ||
| } catch (error) { | ||
| if (signal?.aborted || error instanceof ConfigurationError) throw error; | ||
| throw new ConfigurationError(errorMessage(error), { cause: error }); |
There was a problem hiding this comment.
[P2] Preserve the public plugin-bootstrap error contract
Could we keep PluginBootstrapError for the publicly exported plugin helpers and classify local failures only at the CLI boundary? resolvePluginPath, createMarketplace, pluginMetadata, and bootstrapPlugin now replace established bootstrap failures with the sibling ConfigurationError, and existing tests had to change their expected error class. SDK integrations that catch the exported bootstrap error will stop handling malformed plugins and unsafe marketplace paths.
|
@codex review Please review commit |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Summary
Return privacy-safe, machine-readable errors when scans or saved scan reruns fail in JSON or JSONL mode.
Addresses the structured-output request in #375.
Changes
SCAN_FAILEDandSCAN_REPLAY_UNAVAILABLEerror envelopes on structured stdout, including failures finding the latest completed scan.--full-outputenvelope shapes.LocalPluginBootstrapError, which remains compatible with existingPluginBootstrapErrorcatches. Keep installer subprocess failures distinct from local selection, ZIP manifest, and marketplace-copy failures.Testing
2a37ea13, the neutral typed-error and plugin-error compatibility tests plus existing CLI discovery/help checks passed: six tests, zero failures, 365 assertions.pnpm run types,pnpm run format, andgit diff --check: passed.--version,--help, andpatch --helppassed.301e5415passed 1,299 tests with 11 skips and zero failures after one unchanged timeout retry. That result is historical; a new full suite was not run.Risk and rollout
Structured scan failures now return a safe error envelope instead of empty stdout. They remain complete and parseable when token-count or truncation flags are supplied; successful-result and discovery formatting are unchanged. Local knowledge-base errors use the existing
ConfigurationErrortype. Local plugin setup errors use the compatibleLocalPluginBootstrapErrorsubtype, with underlying failures available throughcause; installer errors are unchanged. Detailed stderr may still contain local diagnostic context. This does not change scan execution, model moderation, refusal policy, account permissions, or partial-result sealing.The main integration adds no new plugin or npm version. Preserve the current draft state and recheck current main before merge.
Public disclosure review
Newly authored material was reviewed for public disclosure. Existing automated review comments contain access-restricted report references; maintainer cleanup remains outstanding.