feat(context): nudge the agent to offer follow-up suggestions when relevant - #597
Conversation
…levant PR #461 shipped the suggest_followup MCP tool and its follow-up card, but nothing prompted the agent to reach for it — usage rode entirely on the tool's own description, and with MCP Tool Search enabled that spec is not in every turn's context, so the tool would rarely be surfaced. Inject a situational, dashboard-only reminder into the per-turn interactive block (the same place the [OPTIONS:] reminder lives). It is gated to dashboard: / dashboard_ session keys because the tool rejects Slack, cron, and subagent contexts, and it is framed as optional and turn-end — not per-turn — so it raises awareness without becoming noise.
Opus 5 Review — ✅ no blocking findingsReviewed No findings. Verdict recorded via the action's structured output for commit False positive or not applicable? A repository writer can comment: |
Arbiter — ✅ no blocking findingsArbiter found no unresolved long-term items that require action before merging Second-order review for Review detailsArbiter-Verdict: PASS No sub-threshold finding meets the long-term-impact bar. Both line-level reviewers (Opus 5, GPT 5.6) reported no findings at all, so there is nothing to weigh from them. The design reviewer passed the PR and raised a single suggestion: surface eligibility for follow-up cards is now encoded in two places — the tool's own context rejection and the Suggested follow-ups (open as issues — non-blocking)
[ARBITER-REVIEWED] e98a675 False positive or not applicable? A repository writer can comment: For a broader accepted-risk deferral, apply |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Design Review (Fable 5) — ✅ PASSAdvisory design-level review of The PR's own commit relative to its fork point touches only Design-Verdict: PASS Real gap (wired-but-inert tool under Tool Search), fixed at the existing per-turn interactive seam, gated and tested; proportionate and reversible. Suggestions
[DESIGN-REVIEWED] e98a675 |
|
Placement looks right to me — I'd keep it in Why not
One thing worth watching: the nudge is injected on every interactive dashboard turn, while its own text argues for restraint ("situational, NOT per-turn... prefer silence"). Repeating a suggestion affordance every turn is a fairly reliable way to get a model to over-fire it. Not a blocker — but if cards start appearing on trivial turns, the per-turn injection is the knob to pull, not the wording. Complementary follow-up: the stated root cause is discoverability — Tool Search keeps the spec out of context. Additive to this PR, not a replacement for it. |
…levant (kirodotdev#597) PR kirodotdev#461 shipped the suggest_followup MCP tool and its follow-up card, but nothing prompted the agent to reach for it — usage rode entirely on the tool's own description, and with MCP Tool Search enabled that spec is not in every turn's context, so the tool would rarely be surfaced. Inject a situational, dashboard-only reminder into the per-turn interactive block (the same place the [OPTIONS:] reminder lives). It is gated to dashboard: / dashboard_ session keys because the tool rejects Slack, cron, and subagent contexts, and it is framed as optional and turn-end — not per-turn — so it raises awareness without becoming noise. Co-authored-by: Kyle Seaman <kseam@dev-dsk-kseam-1b-55230d27.us-east-1.amazon.com>
Problem
PR #461 shipped the
suggest_followupMCP tool and the follow-up card UI, but nothing prompted the agent to actually use it. Usage rode entirely on the tool's own description — and because MCP Tool Search is enabled by default, that spec is not injected into every turn's context, so in practice the agent would seldom surface the tool. The feature was fully wired and inert.Why it matters
An end-of-turn follow-up surface that the agent never reaches for is dead weight. The user asked for the agent to offer follow-ups "when relevant, not on every turn" — which needs an explicit, situational nudge, since the tool cannot rely on being in context.
Fix (symptom → root cause → change)
suggest_followup.context.py— the same place the[OPTIONS:]reminder is appended. It is:session_keystarts withdashboard:/dashboard_). The tool rejects Slack, cron, and subagent contexts (no card surface), so prompting them for it would be pure noise and guaranteed 4xx.[OPTIONS:]: those are inline choices for the current conversation; a follow-up card is a concrete next task handed off (optionally to a new worktree).This is a fast-follow to #461 (merged in
da39b088); the tool and its user-facing doc already exist onmain, so the nudge references a real tool.Tests
test/test_context.py:test_followup_nudge_only_in_dashboard_sessions— the nudge appears for adashboard:session and is absent forNone/cron:/subagent:/slack:keys. Revert-verified: neutering the dashboard gate fails it.test_followup_nudge_requires_interactive— a non-interactive turn gets neither the[OPTIONS:]reminder nor the nudge.Manual verification
N/A — the behavior is a deterministic prompt-string injection fully covered by the two gating unit tests. Full backend suite green (18331 passed; the 3
test_dashboard_originfailures are pre-existingKIROCREW_PORThost-env cases unrelated to this change), mypy clean across 487 files, isort/flake8 clean.Screenshots
N/A — no UI change. The follow-up card surface itself shipped with screenshots in #461; this PR only changes when the agent is prompted to raise one.