fix(daemon): carry projectless refusals as structured content - #2345
Merged
Merged
Conversation
|
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.
This fixes the #2335 follow-up. A refusal answered on the daemon's projectless route (for example
tracedecay serveoutside a project, ortracedecay_project_listthrough the profile owner) put the typedproblemrecord besidecontent, at the top level of thetools/callresult.CallToolResulthas no extension members, so MCP clients received that refusal only as prose. Project connections already move the record intostructuredContent, in the rmcpcall_tooladapter.There is now one renderer,
tracedecay_mcp::tool_errors::structure_tool_problem. The rmcpcall_tooladapter and the projectlesstools/callresponse both call it, so every host-facingtools/callrefusal has the sameisErrorshape:{content, isError: true, structuredContent: {problem}}. The inline copy of the move in rmcp.rs is deleted.Fail-before / pass-after
Test:
daemon::tests::socket::projectless_project_list_reads_the_empty_profile_registry, a real projectless socket connection. It now asserts the refusal record understructuredContent.problemand asserts thatresult.problemis absent.On
origin/mastersource (b836d91) with only this test changed:With this change:
ok.Runtime journey
Setup: debug
tracedecaybuilt from this branch, isolated HOME/profile, one daemon undersystemd-run --user --scope -p MemoryMax=6G -p MemorySwapMax=1G, stopped afterwards.Before this change, the same call answered
keys=['content', 'isError', 'problem']withstructuredContentabsent. That was observed on b836d91 with the same driver.Checks
tracedecay-mcplib: 387 passed.--lib -- daemon:: mcp::: 735 passed, 2 failed, neither in the code this PR touches:runtime_identity::concurrent_same_identity_worktrees…is master-red (test: three suites still expect JSON-RPC errors for owner refusals now rendered as isError #2344).http_application_tests::daemon_http_shutdown_releases_loopback_listenerfailed rebinding a loopback port (AddrInUse) under the shared host's load.cargo clippy -p tracedecay -p tracedecay-mcp --all-targets -D warnings, with and withouttracedecay/test-transport,test-helpers: clean.cargo fmt --all -- --check: clean.