Chat tools: follow-up ids, cancel_followup, run-triggered follow-ups, show_html warnings

- schedule_followup returns the follow-up id and lists pending follow-ups;
  count-then-queue is serialised so the 3-pending bound holds under
  concurrent calls.
- cancel_followup {id} removes one of the chat's undelivered follow-ups.
- schedule_followup {run_id, on: finished|attention} queues a durable
  follow-up (7-day deadline) that is released with the run's state when the
  run ends or waits on a human; run must exist and not already meet the
  condition; watches are re-armed from the restored queue after a restart.
- show_html results warn about scripts, remote resources (blocked by the
  sandbox) and missing dark-mode support.
- The ambiguous-call error advice fits each tool instead of always
  suggesting a different title.
- references/chat.md and the SKILL.md chat paragraph document the above, and
  questions are no longer described as Claude-only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 00:23:22 +00:00
parent accb9970b6
commit d275ffe643
13 changed files with 737 additions and 43 deletions
+4
View File
@@ -191,6 +191,7 @@ func HandlerWithOptions(ctx context.Context, options Options, stores ...*pipelin
tools.runs = stores[0]
tools.broker = options.Chat
events.observe(tools.observeRun)
hub.queueResumed = tools.resumeRunFollowups
registerChatTools(mux, tools, build.Version)
}
mux.HandleFunc("GET /discovery", serveServerDiscovery)
@@ -635,6 +636,9 @@ func HandlerWithOptions(ctx context.Context, options Options, stores ...*pipelin
hub.reattachSessions(ctx, options.Chat)
// Restore live turn ownership before queue rooms can start runners.
hub.resumeQueued(ctx, options.Chat)
if hub.queueResumed != nil {
hub.queueResumed(ctx)
}
close(ready)
hub.observeRunningTurns(ctx, options.Chat)
close(done)