Repository navigation
fix(mcp): guide address context recovery - #8766
Merged
Merged
Conversation
2 tasks done
Contributor
[Low impact] No actionable issue was found that blocks merging this revision. SummaryUpdates
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["inspect_address_context"] --> B{"Comment capability refused?"}
B -->|No| C["Keep the facet result or error"]
B -->|Yes| D{"Retryable or provider recovery supplied?"}
D -->|Yes| E["Keep provider recovery"]
D -->|No| F{"Containing function found?"}
F -->|No| G["Suggest binary_session complete availability"]
F -->|Yes| H["Suggest analyze_function for the same document"]
H -. "Caller follows guidance if supported" .-> I["Page native comments using parent_evidence_id"]
I --> J["Check availability, pages and exact address"]
Reviews (3) · Last reviewed commit: "test(ghidra): verify address comment rec..." · Reviewed by Greptile |
11 tasks
morluto
marked this pull request as ready for review
November 4, 2026 16:53
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. |
Closed
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses #8363.
inspect_address_contextno longer tells callers to repeat an unsupported facet operation. For unavailable comments with a known containing function, it suggests a conditional route through the function's retained dossier.Problem and expected behavior
For a Ghidra function, address context could resolve the containing function while telling callers to invoke unsupported
commentandinline_comment. The complete function dossier already carries address-tagged comments. The result must retain the unavailable state and avoid assigning an entry comment to an interior address.This PR supersedes #8414 for #8363. It includes the real Ghidra COM verifier and covers containment, unsupported operations, retryable failures and provider-specific recovery.
Change and scope
For non-retryable comment capability refusals with no provider-specific remediation, use the resolved entry to suggest
analyze_functionsummary followed by its parent Evidence's paged native comments view. The message conditions this on provider support and the same document, and tells callers to check availability, pagination and the exact address. If no function is known, it points to completebinary_sessionprovider availability and conditionally suggests searching a known name and verifying identity and coordinates after a provider switch. Retryable or provider-specific facet refusals retain their user-facing reason and remediation; unsupported facets point to provider availability; other errors, cancellation and cleanup handling remain unchanged. This is navigation guidance; it neither invokes an extra analysis nor reports comments as available. Theanalyze_functioncatalog description also names comments among the pageable facets.Contract and boundary impact
analyze_functiondescription; no schema changes.Evidence and regression coverage
0x201171in a disposable copy of an existing project, all four compact/full input and output profile combinations produced the new guidance. Following the summary'sparent_evidence_idthroughinspect_analysis_viewreturned the exact interior comment and the separate entry comment. With a one-item page limit, the first page pointed to offset 1 and the interior comment appeared on the exhausted second page. A separate query at0x201185, outside known functions, returned no containing function and provider-availability guidance rather than the dossier route in both output profiles. The original unexecuted ELF SHA-256 remained0cee46f9e95af174dec7f281c179cbe5233348520302c69fdc9eafc7fcebff1d.0xZZ) keptaddress_nameand containing-procedure failures as structuredinvalid_requestfacets with address-format details in both output profiles; no containing-function dossier route was suggested. Unsupported comment facets still reported provider availability.0x1340and Ghidrasearch_proceduresreturned the named candidate at0x101340; Ghidra context resolved that candidate in both output profiles. The unexecuted target SHA-256 stayed5b8bb1398a664530924f4cc47d0eb84927c67e1f6ed634cdd6ec7cf3b769cd09. This is a fixture-specific candidate, not an automatic mapping or general identity guarantee._shared_func, real Kuna and Ghidrasearch_procedureseach returned both distinct addresses with default detail and with complete detail, in compact and full output profiles. This supports treating search results as candidates, not choosing by name alone; the target digest remainedae0f2a349b22332113ab60ab4c78024eb18153c76bdeefb01c4b1d89a26c0003.Validation performed
npm run verify:ghidra:com— passed after incorporating the fix: guide address-context comment recovery #8414 real-provider recovery control, using Ghidra 12.1.4 and JDK 21 on macOS arm64. The public MCP workflow retrieved exact regular and inline comments through the retained dossier and checked outside-function guidance; the fixture remained unchanged and cleanup completed.npm run test:focused -- tests/boundary/mcp/addressContextInputErrors.test.ts src/application/AnalysisContextQueries.test.ts— 36 passed.npm run test:focused -- tests/boundary/mcp/addressContextInputErrors.test.ts— 8 passed after the continuing-session assertion.npm run check:ci:fast— passed after the fixture and assertion corrections.npm run test:focused -- tests/boundary/mcp/addressContextInputErrors.test.ts— 8 passed after those corrections.npm run docs:checkpassed before the test-only refactor.Real Ghidra stdio MCP catalog description, summary, retained comments page, and address-context guidance — passed in all four compact/full input and output profile combinations.
Compatibility, safety, and release
Author readiness
Human owner:
Before merge