GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||
GeezerVison is showing github.com — fix(mcp): wait for pending ToolsChanged reloads before flush resolves (fixes #45333) by optamus-ai · Pull Request #46177 · anomalyco/opencode ConversationSummaryMcpTool.flush only waited for the initial MCP tool registration fiber to complete. If MCP servers connected after the initial registration but before SessionContext.select took its snapshot, the ToolsChanged event triggered a reconcile reload that flush did not wait for. The snapshot was taken with stale tool state, omitting MCP tools from the model request. FixTrack pending reconcile operations via a counter and Deferred waiters in McpTool.layer. flush now waits for both the initial registration AND any in-flight reconcile operations to complete before resolving. This ensures the snapshot captures all MCP tools from independently connected servers. Key changes:
AcceptancePositive case: MCP connects → ToolsChanged → reconcile → flush waits → SessionContext snapshot → model request → MCP tools present ✓ Negative case: MCP tool denied by policy → NOT present in model request (unchanged behavior) Testing
Fixes #45333
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsCo-authored-by: Brendonovich <[email protected]> Co-authored-by: Brendonovich <[email protected]> Extract physical-attempt streaming, tool execution, and durable settlement from the Session runner. Preserve logical-Step retry and recovery policy, use tagged drain outcomes, and fix multi-click selection during auto-copy. Co-authored-by: Brendonovich <[email protected]> Persist background Job ownership and terminal results across server restarts. Resume existing subagent Sessions, admit shell cancellation notices without waking idle parents, and preserve explicit cancellation. …bent (fixes #37795) opencode2 service restart could silently fail to stop a temporarily unresponsive managed service (health probe timeout 2s, find returns undefined) and then ensure() would reuse the original process when it recovered, so restart had a success path where it did not replace the service at all. Fix: Service.stop now returns { stopped, reason } with distinct outcomes for missing registration, stale-registration, still-registered, timeout, and error, preserving stale-registration and reused-PID safety via same() checks and process.kill(pid, 0). Service.restart now checks stopResult.stopped and fails with actionable error 'Service restart failed to stop incumbent (reason: ...). Explicit restart never proceeds to ensure() after an unconfirmed stop.' instead of silently continuing to ensure(). Successful restart now verifies the new instance has a different PID/identity. Preserves ordinary ensure/reconnect idempotent reuse semantics; only explicit restart requires replacement. Covers missing registration, corrupt registration, unreachable health endpoint, rejected/unsupported stop, graceful timeout/escalation, successful replacement, and stale PID protection. Logs whether stop was accepted, unsupported, rejected, timed out, escalated, or skipped. Add deterministic regression test service-restart-race.test.ts proving explicit restart does not silently reuse unresponsive incumbent. Closes #37795 McpTool.flush only waited for the initial MCP tool registration fiber to complete. If MCP servers connected after the initial registration but before SessionContext.select took its snapshot, the ToolsChanged event triggered a reconcile reload that flush did not wait for. The snapshot was taken with stale tool state, omitting MCP tools from the model request. Track pending reconcile operations via a counter and Deferred waiters. flush now waits for both the initial registration AND any in-flight reconcile operations to complete before resolving. This ensures the snapshot captures all MCP tools from independently connected servers. Adds regression tests verifying flush completes correctly and snapshot is valid after ToolsChanged events. Fixes #45333
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. V2 session runner does not include MCP tools in LLM requestsUh oh!
There was an error while loading. Please reload this page. 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. | |||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |