Repository navigation
fix(wasm): retain rejected REA_WABT_BIN_DIRECTORY value in refusal - #7753
ayobamiseun wants to merge 2 commits into
Conversation
The relative-directory guard in WabtArtifactProvider rejected the configured REA_WABT_BIN_DIRECTORY before tool selection with a message that named only the setting and constraint, so the capability_unavailable error carried no record of the value it refused. The missing absolute-directory control already preserves the selected location. Include the rejected spelling in the refusal message, which also flows into details.reason, and distinguish an unset variable from a relative value. Code, retryable and the shared configuration remediation are unchanged.
[Low impact] The reviewed changes appear safe to merge. SummaryPreserves the rejected
Reviews (2) · Last reviewed commit: "test(wasm): verify rejected tool directo..." · Reviewed by Greptile |
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: 4be02e0c68
ℹ️ 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".
| if (!isAbsolute(directory)) | ||
| throw new Error( | ||
| "REA_WABT_BIN_DIRECTORY must be an absolute tool directory.", | ||
| `REA_WABT_BIN_DIRECTORY must be an absolute tool directory; received ${JSON.stringify(directory)}.`, |
There was a problem hiding this comment.
Retain the directory in a structured error field
When this refusal is consumed through CLI or MCP, the selected directory exists only inside the human-formatted message/details.reason string (providerErrorDetails does not expose a separate value), so a client cannot recover the exact selection without parsing mutable English and JSON quoting. This is especially observable for values containing quotes or escapes; carry the raw directory in typed diagnostics/details (and assert that field) while keeping this sentence for display.
AGENTS.md reference: AGENTS.md:L33-L33
Useful? React with 👍 / 👎.
|
Hey @ayobamiseun, thanks for this! The fix looks good. What's left: it has merge conflicts with main in |
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 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 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]>
|
Thank you. #10499 reimplemented this fix and credits this PR (see the PR table), so I'm closing it as superseded. |
Summary
Fixes #7595.
With
REA_WABT_BIN_DIRECTORY=wabt/bin(a relative path),inspect-wasm-artifactcorrectly refused the configuration withcapability_unavailable, but no field of the returned error contained the rejected valuewabt/bin. The refusal now names the received spelling, so the error identifies which configured value it rejected, and an unset variable is reported distinctly from a relative one. The code,retryable: false, and the shared configuration remediation are unchanged.Problem and expected behavior
Trigger: run
rea inspect-wasm-artifact <module> --format jsonwithREA_WABT_BIN_DIRECTORYset to a relative directory. Before:messageanddetails.reasonwereREA_WABT_BIN_DIRECTORY must be an absolute tool directory.with no record of the value. The absolute-but-missing control already preserves the selected location in itsENOENTmessage, so the relative branch was the only refusal that dropped the caller-selected path. Expected (AGENTS.md caller-input invariant, which names paths explicitly): preserve the rejected value while retaining the absolute-directory requirement and the capability refusal.Change and scope
The guard in
src/wasm/WabtArtifactProvider.tsowns this refusal and runs before tool selection, so the fix is at the producing boundary: the thrown message now readsREA_WABT_BIN_DIRECTORY must be an absolute tool directory; received "wabt/bin"., matching the existingreceived ${JSON.stringify(...)}pattern inJadxConfigurationandKunaConfiguration. The previous?? ""collapse of an unset variable into an empty string is replaced by an explicitREA_WABT_BIN_DIRECTORY is not set; it must be an absolute tool directory.message, so omitted and relative values stay distinguishable.WabtFailures.tsalready projects this reason intomessageanddetails.reason; no downstream repair was added. Version-probe diagnostics are not extended to this branch because no tool has been selected yet.Maintainer scope decision: not applicable (ordinary fix within an existing boundary).
Contract and boundary impact
WabtArtifactProvider(phaseconfiguration), consumed unchanged bywabtFailureandprojectAnalysisError. No superseded path.capability_unavailablemessage anddetails.reasontext for this one refusal now include the received value.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/wasm/WabtArtifactProvider.test.tsadds "retains the rejected relative REA_WABT_BIN_DIRECTORY spelling in the refusal", which configureswabt/bin, assertscode: capability_unavailable,retryable: false,received "wabt/bin"in bothmessageanddetails.reason, and that the remediation still names the setting. On the base revision the received-value assertion fails because the message contains no value.src/wasm/WabtArtifactProvider.ts:216-220. I did not re-run the issue's Python CLI fixture.messageanddetails.reasonbecomeREA_WABT_BIN_DIRECTORY must be an absolute tool directory; received "wabt/bin".; with the variable unset they becomeREA_WABT_BIN_DIRECTORY is not set; it must be an absolute tool directory.tests/boundary/mcp/wasmArtifactMcp.test.tsassertions only require the setting name and were not run here.Boundary regressions covered: "Raw identity and normalization" (admitted raw spelling retained) and "Missing, empty, and unknown values" (unset distinguished from a relative value). No lifecycle change.
Validation performed
npm run test:local -- src/wasm/WabtArtifactProvider.test.ts— first run: 2 failed, 43 passed (both failures were in the unrelated "keeps core WASM usable when optional name metadata is …" matrix during an 83 s run on a loaded machine); immediate rerun: 45 passed, 45 total, 21 s.npm run check:fast— passed (2 tasks successful).Compatibility, safety, and release
Author readiness
Human owner: @ayobamiseun
Before merge
type(scope): outcome.🤖 Generated with Claude Code
Adapter validation follow-up
The CLI and in-memory MCP regressions now verify that a relative directory with spaces is returned in the typed refusal and that the selected WASM input remains unchanged. The focused built CLI/MCP suites passed 18 tests,
npm run check:fastpassed, andgit diff --checkpassed on macOS. No real WABT installation is needed for this admission refusal; Windows was not tested.