fix(daemon): ride out projectless mounting refusals in the CLI - #2632
Merged
Merged
Conversation
The one-shot client re-sends a tool call while the owner answers application.runtime.mounting, but it only looked for the problem record at the tool result's top level. The daemon's projectless tools/call route moves that record into MCP structuredContent (the shape tracedecay serve relays to hosts), so a CLI call that landed on that route during a cold open returned the mounting refusal as its answer. The retry check now reads the record from either location. Fixes #2559
|
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. |
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.
Fixes #2559
Cause (production bug, not a stale pin)
core_cli_suite::cli_non_interactive_test::sessions_search_omits_absent_optional_filters_and_preserves_providerspawns a daemon and immediately runstracedecay sessions search. If that call lands during the cold open, it hits the daemon's projectlesstools/callroute. The owner answers the retryableapplication.runtime.mountingrefusal. The route then callsstructure_tool_problem(#2345), which moves the record into MCPstructuredContent.problem, the shapetracedecay serverelays to hosts. The one-shot client's ride-out check,tool_result_retry_after_delay, only read a top-levelproblem. It found nothing and returned the mounting refusal as the answer. The CLI's retained decoder does parse the refusal from the JSON text payload, hencerefused: application.runtime.mountingafter about 0.5 s instead of a retry.Literal reply captured with a temporary client-side print (not committed) during a failing run:
The reply has no top-level
problem. Whether a run fails depends on load (whether the first call beats the open), so the test failed consistently on the shared host and sometimes passed on a quiet one.Change
tool_result_retry_after_delayreads the problem record fromproblem, or else fromstructuredContent.problem. Those are the two shapes the daemon socket emits today (project route, projectless route). Nothing else changes: only a pre-admissionafter_delaymounting record is re-sent.Fail before / pass after
New unit test
daemon::core_client::tests::projectless_mounting_refusal_is_re_sent_after_its_delay. It builds the refusal with the production record authority, applies the productionstructure_tool_problem, and asserts:problemproject_open_retry_waitreturnsSome(250ms)authority-unavailableproblem in the same shape returnsNoneWith the fix reverted:
With the fix:
daemon::core_client::6 passed.Runtime proof (built CLI, real daemon)
The failing journey is the CLI test itself: the built
tracedecaybinary against a real spawned daemon. Six copies ran in parallel to recreate host load:Error: config error: daemon tool tracedecay_message_search refused: application.runtime.mountingChecks
core_cli_suite(--features tracedecay/test-helpers,tracedecay/search-eval, the CIroot-journeysselection): 169 passed, 0 failedcargo clippy -p tracedecay --all-targets --features test-helpers,test-transport -- -D warnings: cleancargo fmt --all -- --check: clean