Repository navigation
fix!: preserve address context input errors - #8419
Merged
Merged
Conversation
BREAKING CHANGE: Strict clients that cached the previous full inspect_address_context output schema must refresh tools/list and accept the typed error field on unavailable facets.
This was referenced Nov 1, 2026
Contributor
[Medium impact] The PR appears safe to merge within its documented compatibility change. Summary
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Inspect explicit address] --> B[Run provider facets]
B --> C{Cleanup or request-level failure?}
C -->|Yes| D[Return top-level error]
C -->|No| E{Facet outcome}
E -->|Success| F[Available value]
E -->|Input refusal| G[Unavailable with canonical error]
E -->|Other failure| H[Existing unavailable outcome]
F --> I[Return combined context]
G --> I
H --> I
Reviews (3) · Last reviewed commit: "chore: resolve main merge conflict for a..." · Reviewed by Greptile |
This was referenced Nov 1, 2026
morluto
marked this pull request as ready for review
November 1, 2026 03:55
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. |
coyoteXujie
pushed a commit
to coyoteXujie/rea
that referenced
this pull request
Nov 2, 2026
* fix: retain address context cleanup failures * fix!: preserve address context input errors BREAKING CHANGE: Strict clients that cached the previous full inspect_address_context output schema must refresh tools/list and accept the typed error field on unavailable facets. * test: use session contract for address context
3 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
inspect_address_contextcan successfully return other facets while a provider rejects one caller input, but it currently discards that facet's typed error and issue details. Preserve the canonicalinvalid_requestprojection on that unavailable facet so the agent can see the rejected field and diagnostic without repeating the operation.Addresses #8415. Builds on #8417, now merged into
main: an input error with incomplete cleanup remains a top-level cleanup failure. Draft #8414 also touches the workflow and verifier; a detached combination has been tested. Draft #8424 is stacked on this PR for a separate resource-capacity recovery case.Change and scope
The context workflow projects the original
AnalysisInputErrorthrough REA's existing error owner. Its unavailable facet carries the canonical error, projected message and recovery; successful siblings remain intact. For example, an unavailable name facet now includeserror.code: "invalid_request"anderror.details.issues, while an available function facet stays available. Other failure types keep their current behavior. The shared canonicalinvalid_requestschema is reused in both context-facet schemas. No new address grammar, implicit document selection, provider retry, or reclassification of a local input failure as a whole-request failure is introduced. This is a read-only workflow fix within existing scope; no new-capability maintainer decision is applicable.Contract and boundary impact
error. Refreshtools/listafter upgrading and accept the newly advertised schema. Ajv 2020 rejected a real new result against the old full schema and accepted it against the old compact schema; both newly advertised profiles accepted it. No compatibility shim is added.Evidence and regression coverage
Real Ghidra 12.1.4 and Kuna 1.986 MCP controls used an unexecuted source-owned arm64 Mach-O. With a wrong document or malformed address, the nested name-facet error retained the same typed issues as the corresponding direct call; the valid-document/address control matched baseline. Both compact and full fetched output profiles were exercised. The target digest was unchanged. The real-Ghidra COM verifier also exercises both rejected inputs through the public SDK and checks the provider-owned issue details.
Controlled MCP tests cover partial success,
conformsToInputContracttrue/false, comment and bookmark failures, both schema profiles, non-input facet failure, and cleanup precedence. Five new mixed-facet cases failed against the #8417 parent and passed with this change. The cleanup case uses a simulated error, not a real provider cleanup failure.Token and size observations
These are measurements of minified JSON payloads using
o200k_base, not a latency, CPU, memory, or autonomous-agent study. On the single Ghidra wrong-document fixture, the context result increased from 225 to 1,881 tokens because two facets each retain full provider diagnostics. The old context result plus one separately issued direct-name error totaled 1,012 tokens, excluding both call inputs; the later retry is not proof of the original observation. The completetools/listpayload increased from 125,362 to 125,379 tokens in compact mode and from 1,040,344 to 1,040,726 in full mode; these are whole-catalog JSON counts for this local tool inventory. Exact costs depend on paths, diagnostics, client presentation and tokenizer. Response-budget overflow for unusually large diagnostics was not exercised. #8364 remains open for a retained aggregate/source-Evidence design that could make a smaller inline response practical without losing the original diagnostics.Validation performed
Latest merge resolution (
527730ddf, mergingmainatd684125ee): the only conflict was the import block inAnalysisContextQueries.ts; the resolved file is unchanged from the prior PR head. The three focused address-context test files passed (43 tests), along withnpm run check:fast,npm run docs:check(including 9 README consistency tests), resolved-file formatting, andgit diff --check. Real-provider verification below is prior evidence and was not repeated for this merge.npm run test:focused -- tests/boundary/mcp/addressContextInputErrors.test.ts tests/boundary/mcp/addressContextBookmarks.test.ts— 15 passed. After the review-only test import change, the six input-error tests andnpm run check:fastpassed again; production code was unchanged.npm run verify:ghidra:com— passed with real Ghidra 12.1.4/JDK 21 on macOS arm64, including the new input-error controls; no target execution, source unchanged and owned processes cleaned up.npm run check:fast,npm run docs:check,git diff --checkand changed-file formatting check — passed.Compatibility, safety, and release
BREAKING CHANGE: A client retaining an older strict full output schema can reject the added facet field. Refresh the MCP catalog and validate against the current advertised schema. Other providers, Windows, real cleanup failures, unusually large diagnostics and autonomous agent behavior are unverified.
Author readiness
Human owner:
Before merge
type(scope): outcome.