Repository navigation
fix(ida): retain bounded stderr on upstream transport failures - #2449
Conversation
|
@greptileai review |
|
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 179f9de299
ℹ️ 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".
Address review findings at their producing boundaries and preserve directly affected consumers. Source inspection and git diff --check completed. Tests and automated checks were not run at the user’s explicit request.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6acda019a5
ℹ️ 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".
|
Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open. IdaCleanupError discarded typed transport diagnostics. It now preserves capturedOutput, upstream diagnostic fields and the original transport reason while retaining cleanup ownership and retry resources. Added close regressions for idb_close, the final idb_list and connection.close failures. Source inspection and git diff --check completed. Tests and automated checks were not run at the user’s explicit request. Commit: 6acda01 The bounded byte tail could begin inside a UTF-8 code point. Projection now skips leading continuation bytes before decoding, retains the original observed byte count, and marks the dropped prefix as truncated. Added a non-ASCII 18,000-byte regression with an exact whole-character tail. Source inspection and git diff --check completed. Tests and automated checks were not run at the user’s explicit request. Commit: 6acda01 The transport wrapper became the public operation owner. IdaSessionClient now rebinds transport ProviderAdapterError to the requested operation while preserving captured output, partial facts and cleanup, and restores the existing recovery guidance. Added an operation-projection regression. Source inspection and git diff --check completed. Tests and automated checks were not run at the user’s explicit request. Commit: 6acda01 Cleanup wrapping now carries capturedOutput and upstream diagnostics into IdaCleanupError, retaining the original transport failure reason rather than the generic wrapper message. The session-close regressions cover both database cleanup calls and client.close failure without surrendering retained workspace ownership. Source inspection and git diff --check completed. Tests and automated checks were not run at the user’s explicit request. Commit: 6acda01 |
|
Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open. Retained transport output caused failure classification to run before caller cancellation. Cancellation now wins first in IdaSessionClient while carrying the producing error's captured output, diagnostics, partial observation and cleanup uncertainty into AnalysisCancelledError. Added cancellation-with-stderr regression coverage. No directly related source cleanup remains. Validation: inspected the producer and affected consumers; targeted formatting applied where applicable. Tests and automated checks were not run at the user’s explicit request. Real-provider/platform execution remains unverified. Commit: ab46104 Leading continuation bytes were trimmed even when no byte eviction occurred. The stderr tail owner now trims a partial UTF-8 prefix only after observed bytes exceed the retained tail; in-budget undecodable bytes remain represented by the decoder. Added a three-byte raw-stderr regression without truncation. No directly related source cleanup remains. Validation: inspected the producer and affected consumers; targeted formatting applied where applicable. Tests and automated checks were not run at the user’s explicit request. Real-provider/platform execution remains unverified. Commit: ab46104 The same stderr tail was projected twice. Removed diagnostics.upstream_stderr so capturedOutput is the single owner of stderr; diagnostics retains the transport reason. Updated consumer expectations and added an assertion that the duplicate field is absent. No directly related source cleanup remains. Validation: inspected the producer and affected consumers; targeted formatting applied where applicable. Tests and automated checks were not run at the user’s explicit request. Real-provider/platform execution remains unverified. Commit: ab46104 |
The attached fixture negotiates the legacy protocol, so list_procedures calls list_functions, never list_funcs. The list_funcs mocks added in #2449 never fired and both tests failed on arrival. No product change.
Summary
Retain bounded upstream stderr when the IDA MCP transport fails.
Problem and expected behavior
If an upstream IDA launcher writes its actual initialization failure to stderr and exits before MCP initialization, REA currently drains and discards that output. The caller receives only
CONNECTION_CLOSED, which hides the diagnostic needed to distinguish an IDA initialization failure from a transport problem. Expected behavior is a failed operation retaining the available producer diagnostic.Change and scope
This retains a bounded 16 KiB diagnostic tail and attaches it to genuine transport failures as
ProviderAdapterError.capturedOutput, with the original byte count and explicit truncation flag. Retained bytes are copied so the tail does not keep a larger backing buffer alive. Existing transport credential redaction and failure behavior remain in place; no ambient environment is persisted. Maintainer scope decision: not applicable to this routine diagnostic fix within the existing read-only IDA adapter.Contract and boundary impact
IdaMcpConnection's stdio diagnostic stream.Expected effects: the existing stdio adapter launches the configured upstream process; the added tests launch controlled Node children. No new target mutation, injection or protection recovery is introduced.
Evidence and regression coverage
truncated: true.Validation performed
npm run test:focused -- tests/boundary/idaStartupDiagnostics.test.ts— 2 pass; both fail against original main becausecapturedOutputis missing.npm run test:local -- src/ida/IdaMcpConnection.test.ts src/ida/IdaOperationFailures.test.ts src/domain/functionComparison.test.ts— 67 pass in the combined local validation build.npm run check:fastandnpm run build:cached— pass.Compatibility, safety, and release
No migration is required. HTTP diagnostics and failures with no stderr retain their existing path. This error-evidence change does not establish real Hopper/Ghidra or OS/provider coverage. Only configured transport authentication values are redacted; arbitrary upstream producer text is preserved under the existing evidence policy. The child-process regressions require no licensed IDA installation.
Before merge