Repository navigation
fix(tui): rebuild the agent for every MCP tool-set change - #1494
Merged
corbits-triage[bot] merged 7 commits intoOct 17, 2026
Merged
corbits-triage[bot] merged 7 commits into
corbits-triage[bot] merged 7 commits into
Conversation
The reactor authorizes against the tool definitions it snapshotted at build. A tool mounted later was still found by tool_search and could reach the wire, but an ask on it had no definition to build an approval prompt from and failed as a wiring defect. The TUI now pins the tool set at each build: search, the advertised wire, and authorization only see pinned tools, a late hit tells the model it becomes callable next turn, and a rebuild with nothing new to pin is skipped.
Contributor
|
Triage: Pass No changes needed from you. A maintainer will review this pull request. |
TheGreatAxios
approved these changes
Oct 17, 2026
TheGreatAxios
left a comment
Collaborator
There was a problem hiding this comment.
Review · Approve
The TUI rebuilds the agent on every MCP tool-set change and keeps tools mounted after the current build off the wire, search, and authz until that rebuild.
Findings
No findings.
TheGreatAxios
left a comment
Collaborator
There was a problem hiding this comment.
Review · Comment
Planner: approach holds. A TUI tool-set change reaches the reactor only through an idle rebuild, including while a rehydrated approval has no open run. Search, the advertised wire, and authorize see the pinned set; a late call is denied before the gate. The task list and sticky compact instructions carry across a same-session rebuild. Exec still uses live dispatch and does not clear the TUI pin.
Findings
No findings.
A rebuild must clear the rehydrated-approval hold, or the next idle check still treats the session as resuming. Interrupt and session rotation also clear a deferred reload before buildAgent awaits, so a connect during that build can still set the flag. Initial and mcp-tools-changed builds leave pendingReload for reloadIfIdle.
TheGreatAxios
changed the base branch from
cl-10766-dont-reload-the-agent-while-an-approval-resumed-run-is-still
to
main
October 17, 2026 05:56
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.
Summary
/mcp add, retry, enable, disable, remove) reaches the reactor only through an agent rebuild. Nothing mutates a live agent's tools anymore. Interchange fixes an agent's tool set at build, so this lets authz see every tool the agent can call.message.correlatedwith no open run as busy until the reply, run end, fatal error or done.tool_searchuntil the rebuild. A call to one gets an actionable "becomes callable once this turn ends" denial instead of the authz wiring-defect error. A non-read-only MCP tool added after startup now gets an approval prompt and runs once approved.initial,mcp-tools-changed,interrupt,session-rotation) and the tool names it added, removed or changed.vendor/.corbits execstill adds late MCP tools to a live agent and keeps the live-dispatchMapworkaround; its comment now names that caller.Stacked on #1486; review that first. The diff against its branch is this change only.
Verification
bun run checkandbun run testpass (9211 tests)Fixes CL-10782
Refs CL-10777
Part of CL-10763