fix: re-probe live gateway after safeoutputs tools.json recovery to prevent silent no-op runs#46780
Conversation
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ |
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. No ADR enforcement needed: PR #46780 does not have the 'implementation' label and has 0 new lines of code in business logic directories (threshold: 100). |
|
✅ Test Quality Sentinel completed test quality analysis. No test files were added or modified in this PR. Test Quality Sentinel skipped. |
|
✅ PR Code Quality Reviewer completed the code quality review. |
There was a problem hiding this comment.
This PR has no changed files — the head commit contains zero additions or deletions. Both mount_mcp_as_cli.cjs and mount_mcp_as_cli.test.cjs are identical to main. The described fix (async re-probe, fail-fast on 0 tools) is not present in the diff. Please push the actual changes to the branch before this can be reviewed.
🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · 28.7 AIC · ⌖ 4.32 AIC · ⊞ 5K
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd — the PR branch currently contains only an "Initial plan" commit with 0 changed files. Code review will follow once the implementation is pushed.
📋 What to verify when the code lands
/diagnosing-bugs
- Is the root cause fully addressed? The re-probe validates gateway readiness, but consider whether the underlying race (gateway session not yet ready at mount time) could be mitigated upstream rather than re-probed.
- Does the
throwon 0 live tools surface a clear, actionable message in the workflow log — not just a generic error? - Is there an integration-level test or reproduction script that confirms the original silent-no-op scenario is gone?
/tdd
- The two planned tests (reprobe succeeds / reprobe still returns 0) are a good start. Also add: reprobe throws an exception — does the caller surface or swallow that?
- Async edge case: if
reprobereturns >0 tools but the live gateway becomes stale again on the very first real call, is that detectable? - Test names should read as specifications: e.g.
"returns live tools when reprobe finds the gateway has caught up"is clearer than"reprobe succeeds".
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · 30.7 AIC · ⌖ 4.42 AIC · ⊞ 6.7K
Comment /matt to run again
There was a problem hiding this comment.
No code changes to review
This PR currently contains only a planning commit ("Initial plan") with 0 file changes. The description outlines the intended fix for the silent no-op issue in recoverSafeOutputsToolsIfNeeded, but no implementation exists yet.
📋 Expected changes per PR description
mount_mcp_as_cli.cjs: makerecoverSafeOutputsToolsIfNeededasync, addreprobecallback, hard-fail when re-probe still returns 0 toolsmount_mcp_as_cli.test.cjs: update existing tests to async/await, add two new re-probe test cases
Re-request review once implementation commits are pushed.
🔎 Code quality review by PR Code Quality Reviewer · 43.3 AIC · ⌖ 4.36 AIC · ⊞ 5.6K
Comment /review to run again
When
safeoutputstools/listreturns empty at mount time, the file-based recovery inrecoverSafeOutputsToolsIfNeededreads fromtools.jsonand logs "recovered N tool(s)" — but the live gateway session still advertises"tools":[]. Every tool call (push_to_pull_request_branch,add_comment,noop,report_incomplete) then fails with "unknown tool". Because the only failure-reporting channel is itself a safeoutputs tool, the run silently concludes as a green "graceful no-op" success.Changes
mount_mcp_as_cli.cjs— core fixrecoverSafeOutputsToolsIfNeededis nowasyncand accepts an optionalreprobecallbackreprobeis provided the live gateway is re-queried:SERVER_VALIDATORSupdated to forward thereprobecallbackmain()passesreprobe = () => fetchMCPTools(url, apiKey, core)andawaits the validatormount_mcp_as_cli.test.cjs— test coverageasync/await