Repository navigation
fix(mcp+chat): spawn_blocking tool execution; never drop typed input - #126
Merged
Merged
Conversation
…121) - mcp_server call_tool runs execute_checked (subprocess waits of up to 420s) via tokio::task::spawn_blocking so one slow tool call cannot pin the async runtime's workers; RegistryServer is now Arc-Clone to move a handle into the blocking task. Existing end-to-end MCP tests exercise the new path (mcp feature). - chat REPL resolve loop: UnknownTool / BudgetExhausted / LoopDetected / Storage outcomes and resolve Err now flag dropped_message (the typed line never reached the durable log) and the Err path prints the same NOT-recorded note before bailing — closing the silent-input-drop gap cora full-scan #7 flagged for non-retryable outcomes (B1 contract: user input is never silently dropped).
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
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.
What (description of the change)
Two cora full-scan MAJORs, one PR:
call_toolnow runsexecute_checkedviatokio::task::spawn_blocking. Tool execution is synchronous and can block for a long time (git 120s, run_command 420s budgets); running it inline pinned the async runtime's workers, stalling every other request the server was serving.RegistryServeris nowClone(Arc-shared registry) so a handle moves into the blocking task.dropped_messageonly for ApprovalRequired/ProviderFailed. UnknownTool, BudgetExhausted, LoopDetected, and Storage outcomes — and the resolveErrpath — silently continued as if the typed line had been recorded. All of them now setdropped_message(the "message you just typed was NOT recorded" note), and theErrpath prints the same note before bailing.Why (the problem you're solving)
Closes #121 (cora full-scan MAJORs #29 and #7). #29 starves the MCP server's runtime under one slow tool. #7 violates B1's core contract — the dispatch loop must never drop user input silently.
Testing (how you verified this works)
--no-default-features) green; clippy-D warningsclean; cora review: No issues found.