Repository navigation
fix(errors): separate recovery actions from failure messages - #4829
prabhuramkarki wants to merge 3 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The reviewed changes appear safe to merge. SummaryThe PR gives default failures separate recovery actions while preserving explicit guidance and producer messages.
Reviews (3) · Last reviewed commit: "test(errors): preserve retained cleanup ..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f8242f48f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
CassieFox23
left a comment
There was a problem hiding this comment.
TL;DR: This is a code read. I ran nothing. The change is still needed on main for six of the seven error types, and it applies without conflicts. It needs a rebase first: main has moved on, and two of its new test rows plus one existing test on main would fail.
I read the PR head 373c3b7 against main ad518cf and the merge base 3927542. Main is 2,795 commits past that base.
Should fix
-
The timeout default can never run on main. Main returns its own timeout recovery for every timeout error. See
analysisErrorPresentation.tsline 135 and lines 142 to 147 on main. Both exits come before the spot where the PR adds its checks (lines 264 to 266). So the new "Narrow the request" branch is dead code there. Two new test rows then expect text that main never returns:analysisErrorProjection.test.tsline 586 expects an action that starts with Run, Start or Narrow. Main gives "Inspect any partial Evidence...".- Line 603 expects the custom
userMessageas the action. Main gives the timeout recovery.
Main already keeps the timeout action apart from its message. Dropping the timeout branch and those two rows at rebase would fit.
-
An existing test on main breaks. In
WakaruReport.test.tson main, lines 74 to 76 expect the action to equal the message for aProviderAdapterError. That test sets nouserMessageand noremediationAction. So its message is the standard text, and today its action is the same text. With this PR, the action becomes the new adapter default, so the check fails. The test came in with a0214e0 (#6022) on 22 Oct, after this branch was synced. So you could not have seen it.
Nit
- The body says seven error classes change. On main it is six, because of finding 1.
- The body's test counts were taken on 3927542. They say nothing yet about main.
- Only three checks ran on this head: Greptile, PR readiness and the author declaration. All pass. No build or test job is listed. The body says upstream CI is waiting for approval.
- The new line
if (error.userMessage !== undefined) return error.userMessage;(head line 141) returns the message alone. The old fallback adds a sentence for a caller that keeps going (main lines 382 to 390). Is that drop on purpose? I did not look for a producer that sets that sentence without aremediationAction.
Looks good
- It is still needed. Line 266 on main still falls back to
analysisErrorUserMessage. Main's batch decompile test shows the message and the action as the same text forAnalysisOutputError(lines 620 to 624 ofenhancedTools.callPathsAndBatches.test.ts). - The order matches the body. A set remediation wins first, then the special cases. Then comes the producer's
userMessage, and last the defaults. ProviderCleanupErrorsets its ownuserMessage(lines 11 and 12 ofproviderCleanupError.ts). So the guard keeps its cleanup text. A new test pins that (analysisErrorCleanup.test.ts, line 19).- Kuna sets a "reopen the target"
userMessage(KunaCommand.tsline 217 on main), and the guard keeps it. The new Kuna check pins that. By my read it also passed before this change. So it guards against a regression rather than proving a fix. - I applied the PR diff to main's five files with
patch --dry-run. There were no rejects. Some hunks landed with offsets and fuzz.
Not run
- No tests, no typecheck, no build. Only a run of
test:faston the rebased branch settles whether it passes. My two test findings come from reading the code paths. - I did not search for other tests on main that compare an action to a message for the changed tags. I found the Wakaru one by grep, so there could be more.
Where I looked
| Tree | File | Lines |
|---|---|---|
| Head 373c3b7 | src/domain/analysisErrorPresentation.ts |
85, 141–151 |
| Head 373c3b7 | src/domain/analysisErrorProjection.test.ts |
579–640 |
| Head 373c3b7 | src/domain/analysisErrorCleanup.test.ts |
19 |
| Main ad518cf | src/domain/analysisErrorPresentation.ts |
130–147, 264–266, 382–390, 579–619 |
| Main ad518cf | src/javascript/recovery/WakaruReport.ts |
108–125, 156–170 |
| Main ad518cf | src/javascript/recovery/WakaruReport.test.ts |
74–76 |
| Main ad518cf | src/kuna/KunaCommand.ts |
217 |
| Main ad518cf | tests/boundary/mcp/enhancedTools.callPathsAndBatches.test.ts |
620–624 |
Main has changed analysisErrorPresentation.ts in 30 commits since 3927542. The function now takes a caller lifetime. The PR branch does not have it.
🤖 Written with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊
Summary
Addresses the default error-remediation portion of #4815, item 8. Protocol/output failures, adapter failures, cancellations, and timeouts now return an imperative default recovery action instead of repeating their failure message. Producer-authored messages and explicit remediation retain their existing precedence.
Problem and expected behavior
A plain
AnalysisOutputErrorpreviously repeated “Analysis returned an unreadable result…” inremediation.action. Its default action now starts “Runrea doctor…”. Custom Ghidra and Kuna messages still direct callers to reopen the target when the current provider or executable identity is lost.Change and scope
Reuse the error-tag groups in the shared domain presentation owner. Apply generic defaults only after explicit remediation, specialized handlers, and custom producer messages. This preserves existing producer guidance without provider-specific repairs or text parsing. Update the MCP batch-decompile expectation and add projection and Kuna boundary regressions.
Synced the branch with upstream main
39275420e, which includes the existing French README formatting and composed Electron cleanup assertion fixes from #4824.Contract and boundary impact
analysisErrorRemediationAction; shared CLI/MCP and doctor consumers receive the same defaults.Expected effects:
Evidence and regression coverage
ProviderCleanupErrorinherits the adapter tag but supplies its own cleanup-specific message. The same shared guard preserves that message before the generic adapter default. A regression verifiescleanup_incomplete, non-retryability, retained resource ownership, and unchanged cleanup advice; it failed when the guard was removed and passed when restored. No additional producer repair or cleanup remains for this finding.Validation performed
Node 24.18.0 / npm 11.16.0 through
npm exec:npm run test:focused -- src/ghidra/GhidraProvider.behavior.test.ts src/domain/analysisErrorProjection.test.ts tests/boundary/mcp/enhancedTools.callPathsAndBatches.test.ts tests/conformance/contracts/analysisErrorProjection.test.ts tests/boundary/process/electronLaunchRejections.test.ts tests/boundary/providers/kuna/kunaProvider.test.ts— 258 passed; runtime artifacts prepared.npm run check— passed, including typecheck, compilation, lint/module boundaries, repository formatting, knip, metadata, and architecture guards.npm run test:local -- src/domain/analysisErrorCleanup.test.ts src/domain/analysisErrorProjection.test.ts— 82 passed after adding the cleanup review regression.git diff --check— passed.npm run test:fast— all 643 source test files passed at production-fix head61fe76b46: 10,532 tests passed and 8 skipped.Compatibility, safety, and release
No schema migration, new dependencies, target side effects, or release metadata changes. Ghidra and Kuna provider boundaries used simulated providers; no native Ghidra/Kuna target session or Windows qualification was performed. The complete built/portable repository suite and performance profiling were not run.
GitHub validation status
Upstream CI and readiness are checked separately from these local results. This contributor account cannot approve fork workflow runs or rerun upstream readiness workflows (HTTP 403: repository admin rights required). Upstream CI is
action_requiredwith no jobs executed. Readiness remains pending because GitHub reports no upstream commit-to-PR association for the fork head. These statuses must pass before merge; local validation does not replace them.Author readiness
Human owner: @prabhuramkarki
Keep this AI-assisted PR in draft until the human owner completes these declarations.