Suppress spurious 'is now available' MCP toolset notice#2578
Merged
dgageot merged 2 commits intodocker:mainfrom Apr 28, 2026
Merged
Conversation
After a user completes an OAuth flow for an MCP server, the TUI displayed a notification framed as a warning, e.g.:
mcp(remote host=mcp.slack.com transport=streamable) is now available
It is not a valid warning: the OAuth dialog completing already makes a successful start obvious, and for non-OAuth recoveries the model just uses the tool. The follow-up notification was pure noise.
Drop the entire tool-notice path in the agent and runtime:
- pkg/agent/agent.go: remove pendingNotices field, AddToolNotice, DrainNotices. ensureToolSetsAreStarted still calls ConsumeRecovery() so the failure-streak flag is reset (next failure is reported as fresh), but only logs at slog.Info — never user-visible.
- pkg/runtime/loop.go: emitAgentWarnings only drains warnings now; formatToolNotice is gone.
- tests updated to assert recoveries are silent.
Assisted-By: docker-agent
Now that the recovery notice has been dropped, the only consumer of `ConsumeRecovery()` was a state-reset call in agent.ensureToolSetsAreStarted. Fold that reset into Start() itself: a successful Start now implicitly clears the failure streak, so any future failure is again reported as fresh.
- pkg/tools/startable.go:
* 3 booleans (`hasEverFailed`, `freshFailure`, `pendingRecovery`) collapse to 2 (`inFailureStreak`, `pendingWarning`)
* `ConsumeRecovery()` API removed entirely
* struct doc reads as one paragraph instead of a four-bullet state-machine spec
- pkg/agent/agent.go: ensureToolSetsAreStarted shrinks from a fail/recover diptych to a flat 'try, warn-once-on-failure' loop. `desc := …` is computed once per iteration.
- pkg/tools/startable_test.go: tests assert observable behaviour (warn-once-per-streak, recovery resets streak, Stop resets state) instead of probing internal flags via `ConsumeRecovery`.
- pkg/runtime/runtime.go, runtime_test.go: comments and test name updated to match the new vocabulary (no "freshFailure" terminology).
All callers untouched in observable behaviour. Net: -47 lines, one boolean and one public method removed, behaviour identical and verified by the unchanged end-to-end tests in pkg/agent and pkg/runtime.
Assisted-By: docker-agent
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
After completing an OAuth flow for a remote MCP server, the TUI displayed a notification framed as a warning:
This is not a valid warning. The OAuth dialog completing already makes a successful start obvious, and for non-OAuth recoveries the model just uses the tool — the follow-up notification is pure noise.
Changes
Commit 1 — Suppress the notice
Drop the entire tool-notice path in the agent and runtime:
pkg/agent/agent.go: removependingNoticesfield,AddToolNotice,DrainNotices.ensureToolSetsAreStartedstill resets the failure-streak flag on a successful start (so the next failure is reported as fresh), but only logs atslog.Info— never user-visible.pkg/runtime/loop.go:emitAgentWarningsonly drains warnings now;formatToolNoticeis gone.Commit 2 — Simplify the resulting state machine
With the recovery notice gone, the only consumer of
ConsumeRecovery()was a state-reset call inagent.ensureToolSetsAreStarted. Folded that reset intoStart()itself: a successfulStartnow implicitly clears the failure streak.StartableToolSetflagshasEverFailed,freshFailure,pendingRecovery)inFailureStreak,pendingWarning)Start,Stop,ShouldReportFailure,ConsumeRecoveryStart,Stop,ShouldReportFailureensureToolSetsAreStartedBehavioural guarantees preserved
inFailureStreakgate prevents re-queueingpendingWarningon repeated retries.Startresets both flags, so the next failure is again surfaced as a fresh warning.emitToolsProgressivelystill checksIsAuthorizationRequired(err)beforeShouldReportFailure(), so the eventual real failure (Slack 4xx, etc.) is the one the user sees.These three properties are pinned by tests in
pkg/tools/startable_test.go,pkg/agent/agent_test.go, andpkg/runtime/runtime_test.go.Validation
mise lint→0 issues(golangci-lint) +no offenses detected(in-tree linter, 886 files)mise test→ all packages passFiles touched