Repository navigation
fix: keep refusal reasons and recovery actionable - #10499
Conversation
Codex Review Summary: ❌ FailedThis 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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] Appears safe to merge, with one non-blocking edge case in Bun registration reports. Findings
Fix with agent prompt### Issue 1
src/serverIdentity.ts:34
`compareServerPaths` now applies Node's path shortcut to Bun too. If Bun runs `/work/rea.mjs`, but the expected registration is `/work/link/../rea.mjs` where `link` points to `/other/scripts`, that registration selects `/other/rea.mjs`. The shortcut still returns `aligned` and skips the file check. This hides the mismatch from `binary_session` and leaves the user without a reason to fix the registration.
Use the existing runtime-aware `normalizeEntrypointPath` so the Node fix preserves Bun's filesystem traversal.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryKeeps refusal reasons and recovery details intact across CLI and MCP errors.
Reviews (6) · Last reviewed commit: "test(native): pair the truncated export ..." · Reviewed by Greptile |
ccc88aa to
a7d29fc
Compare
| ): "aligned" | "mismatch" | "unknown" => { | ||
| // The runtime normalizes its entrypoint lexically, so a lexical match stays | ||
| // aligned even when the spelling crosses a symlink before `..`. | ||
| if (resolve(expected) === observed) return "aligned"; |
There was a problem hiding this comment.
Bun registrations can look aligned
compareServerPaths now applies Node's path shortcut to Bun too. If Bun runs /work/rea.mjs, but the expected registration is /work/link/../rea.mjs where link points to /other/scripts, that registration selects /other/rea.mjs. The shortcut still returns aligned and skips the file check. This hides the mismatch from binary_session and leaves the user without a reason to fix the registration.
Use the existing runtime-aware normalizeEntrypointPath so the Node fix preserves Bun's filesystem traversal.
Knowledge Base Used: MCP client registration
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/serverIdentity.ts
Line: 34
Comment:
**Bun registrations can look aligned**
`compareServerPaths` now applies Node's path shortcut to Bun too. If Bun runs `/work/rea.mjs`, but the expected registration is `/work/link/../rea.mjs` where `link` points to `/other/scripts`, that registration selects `/other/rea.mjs`. The shortcut still returns `aligned` and skips the file check. This hides the mismatch from `binary_session` and leaves the user without a reason to fix the registration.
Use the existing runtime-aware `normalizeEntrypointPath` so the Node fix preserves Bun's filesystem traversal.
**Knowledge Base Used:** [MCP client registration](https://app.greptile.com/-/switch-tenant?tenant=pre&next=%2Fcustom-context%2Fknowledge-base%2Fmorluto%2Frea%2F-%2Fdocs%2Fmcp-client-registration.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.c378453 to
f682d80
Compare
) Fixes #7569 Supersedes #7577 Co-Authored-By: gensokyo-dev <[email protected]>
Refs #7569 Co-Authored-By: gensokyo-dev <[email protected]>
Fixes #8844 Supersedes #8849 Co-Authored-By: gensokyo-dev <[email protected]>
A hardened-runtime client without the Apple Events automation entitlement got generic Automation advice, and the projection kept retryable: true, so agents retried from the same unauthorized client. The denial is now a typed launch rejection whose message and recovery name the entitlement and the Automation setting, with retry turned off. Fixes #9879 Squashed from #9916 and rebased onto main. Co-Authored-By: morluto <[email protected]> Co-Authored-By: gensokyo-dev <[email protected]>
…ack fails When the byte reader for inspect_native_dispatch_metadata refuses a target (for example a 32-bit Mach-O) and the list_names symbol fallback then fails or returns an invalid inventory, only the fallback's error reached the caller. Retain the reader failure under diagnostics.binary_metadata_failure. Fixes #7651. Carries forward e7884a7 (by @morluto, on @dreinst's #7701). Signed-off-by: Zhaowei Gu <[email protected]> Supersedes #8036 Co-authored-by: morluto <[email protected]> Co-Authored-By: gensokyo-dev <[email protected]>
The darwin-only acceptance test passes the caller's environment to the CLI and points only Hopper, Ghidra and Java at missing paths. On macOS the list_names fallback has four candidates (ghidra, hopper, ida, kuna), so a REA_IDA_MCP_CONFIG or REA_KUNA_COMMAND set in the developer's shell still reaches it: with REA_KUNA_COMMAND set, kuna is no longer rejected as not_configured. Point both at missing paths, as tests/acceptance/nativeDispatchSnapshot.test.ts does, so the test always exercises the unavailable fallback. Signed-off-by: Zhaowei Gu <[email protected]> Refs #7651 Co-Authored-By: gensokyo-dev <[email protected]>
A cursor for another target, profile, pattern, mask, bounds, or document was reported as invalid input and pointed at schema repair. Name the binding, attribute the issue to the cursor, and leave the differing component unknown. Fixes #8366 Supersedes #8420 Co-Authored-By: gensokyo-dev <[email protected]>
The native export parser throws one BinaryResourceFailure for both its 262144-entry inventory ceiling and its 16 MiB retained-text byte budget, and NativeExportsProvider mapped every such refusal to the fixed-count recovery. A PE whose export names exhaust the byte budget therefore reported reported_limits.maximum 16777216 next to "is a fixed count". Tag each parser allowance at the producing boundary (NativeExportLimitFailure with limit "rows" or "retained_text") and let the provider select count, byte, or structural-decoding recovery from that tag instead of from message text. The refusal code, non-retryable flag, message, and reported maximum are unchanged. Fixes #7628 Supersedes #7754 Co-Authored-By: gensokyo-dev <[email protected]>
Refs #7628 Co-Authored-By: gensokyo-dev <[email protected]>
Refs #7442 Fixes #7442 Supersedes #7875 Co-Authored-By: gensokyo-dev <[email protected]>
Refs #7442 Co-Authored-By: gensokyo-dev <[email protected]>
Fixes #7570 Supersedes #7589 Co-Authored-By: gensokyo-dev <[email protected]>
Refs #7570 Co-Authored-By: gensokyo-dev <[email protected]>
A relative REA_WABT_BIN_DIRECTORY was refused with only the setting name, and an unset value was indistinguishable from an empty one. The admission refusal now carries the rejected value as diagnostics.configured when it is set. Fixes #7595 The idea and original report are from #7753 by ayobamiseun, which targeted a message that WabtAdmissionError has since replaced. Co-Authored-By: ayobamiseun <[email protected]> Co-Authored-By: gensokyo-dev <[email protected]>
A padded PE dependency section that overflowed inflate allocation reported the storage-based allowance (section size x 64) as the generic size limit, which reads as the smaller limit the docs derive from the consumed stream. The stream length is unknown when inflate stops, so the enforced bound stays the reported maximum_bytes and the message now says it was derived from the padded storage size. Fixes #9227 Co-Authored-By: gensokyo-dev <[email protected]>
Any canonical-form mismatch reported "Evidence bundle manifests are not canonical", so a bundle whose records were out of order, or whose unknowns differed, blamed unchanged manifests. The error now names the top-level sections that differ from canonical form, for example "Evidence bundle sections are not canonical: records". Fixes #7330 Based on #7358 by zzrs-xxxr, which split records from manifests; this reports every differing section instead, so unknowns or several sections are attributed correctly. Co-Authored-By: zzrs-xxxr <[email protected]> Co-Authored-By: gensokyo-dev <[email protected]>
MCP errors now also carry open-session facts (selection and target at failure), so the CLI/MCP comparison checks that MCP keeps the CLI's snapshot details rather than requiring identical objects. Refs #7442 Co-Authored-By: gensokyo-dev <[email protected]>
Refs #7442 Co-Authored-By: gensokyo-dev <[email protected]>
Merging the native export capacity tests made one describe block exceed the lint function-length limit. Refs #7628 Co-Authored-By: gensokyo-dev <[email protected]>
Each snapshot entry is validated alone, so its schema issue path started at the entry. Prefix it with entries or workflow_entries and the entry index so the reason names the entry to repair, and match the header case's issue count without freezing the whole sentence. Co-Authored-By: gensokyo-dev <[email protected]>
A padded PE section above 128 KiB derives an allowance larger than the fixed 8 MiB cap, so the cap is what inflate enforces. Name the padded storage size only when its allowance is below the cap. Co-Authored-By: gensokyo-dev <[email protected]>
Keep the bridge cursor-mismatch code check without copying its message, and let the pcap relative-tool diagnostic use the shared child deadline, which it does not test. Co-Authored-By: gensokyo-dev <[email protected]>
… does Node resolves its script entrypoint lexically, so a registered spelling that crosses a symlink before `..` names the running file lexically, while Bun follows native traversal (#8844). Select the expected server path with the shared runtime-aware entrypoint normalizer before comparing it with the running entrypoint, and fall back to file identity only when they differ. Co-Authored-By: gensokyo-dev <[email protected]>
Add a PE whose section stores every declared export slot, so the entry allowance refusal is also shown for a structurally possible table, and use it over MCP. Leave dispatch-test directory removal to its temporary fixture. Co-Authored-By: gensokyo-dev <[email protected]>
|
Re the Bun registration finding in the latest summary: valid. |
f682d80 to
e967bac
Compare
Summary
Eleven refusals or diagnostics that hid the reason, named the wrong limit, or pointed agents at the wrong recovery. Each commit keeps its contributor's authorship, so merge with rebase.
Fixes #7569
Fixes #8844
Fixes #9879
Fixes #7651
Fixes #8366
Fixes #7628
Fixes #7442
Fixes #7570
Fixes #7595
Fixes #9227
Fixes #7330
binary_sessionregistration compares entrypoint file identity (dev+ino), so a symlink or..spelling of the same Bun entry matchesconformsToInputContract, not schema-repair adviceanalyze --snapshotkeeps the first schema issue's location and message, not a constant reasonREA_WABT_BIN_DIRECTORYrefusal carries the rejected value asdiagnostics.configured; unset stays distinctrecords,providers, ...) instead of always blaming manifestsChange and scope
Each item was checked against current main before it was taken (all were still present). Changes made while rebasing:
screenshot/accessibilityfield descriptions instead of copying them.WabtAdmissionError, so the fix moved to the admission detail.unknowns(or several sections) differ. The error now lists every differing top-level section.maximum_bytesto be 64× the consumed stream. When Node stops the inflate, the stream length is not known yet, and the bound actually enforced is the storage-based one. Reporting the stream-based number would misstate what was enforced. The message now explains the basis instead. Say if you prefer a two-pass inflate that measures the stream first.remediationin its availability.cli.runandtoMatchObject, because MCP errors now also carry open-session facts.Contribution scope: ordinary fixes within existing boundaries; maintainer scope decision not applicable.
Evidence and regression coverage
configured(WabtArtifactProvider.test.ts), the padded-storage inflate message (RustAuditableReader.test.ts), and theprovidersandproviders, recordsattribution cases (evidenceBundle.test.ts).records/providers.Validation performed
npm run test:focused --on the 24 changed test files: 776 passed, 8 skipped (platform-gated). One assertion failed before the snapshot comparison was adapted (explained above).npm run check:fast(pre-push): passed.GhidraSessionError.test.tsand the bridge-sources lane), macOS native UI ([Bug] Native UI commands hide the reason both capture sources are refused #7570).Compatibility, safety, and release
retryable.Author readiness
Human owner: N0zoM1z0 (PR author, exempt from the declaration per CONTRIBUTING.md).
Supersedes #7577, #8849, #9916, #8036, #8420, #7754, #7875, #7589, #7753 and #7358.