Repository navigation
feat(server): tell the parent when a delegated worker ran a fallback model or withheld its task - #78
Conversation
…model or withheld its task A child run that ends now yields a workerAlert when the provider ran another model, a provider safeguard fell back, the run hit a usage limit, or the final message holds or asks for confirmation instead of working. The alert rides the existing delegate result: it is stored on the parent's task row, leads the wake with the child link, flags the notification summary, and is readable from task_status, t3_thread_read and remote delegation. Nothing acts on it automatically. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
START / checkpoint (worker alert for delegated threads; Builder lane, delegated by Kameron through Lead)
|
|
Independent bot review (the one round for this PR). The reviewer was an automated delegated agent, Claude Sonnet 5.5, run from T3. This is not a human review. The first attempt on Codex failed on a 429 usage limit before it produced any review. Base Findings and what happens to each (repair round 1)
Checked and fine according to the reviewer: stale alerts are stripped on re-finalize, the remote path is first-result-only, the old-peer fallback works, and all new schema fields are optional. |
…lies From the review: the withheld-task check now judges only short replies, model aliases with a context suffix compare equal, t3_thread_read judges only agent-created threads, and the wake states the alert once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Checkpoint: pushed the review fixes as |
|
RESULT: complete.
|
…he watcher Review fixes for the model alert reactor: - A completed run with no problem clears the thread, so a usage-limit alert on a provider that reports no model can alert again later. - Only a delegated child skips the watcher when the watcher is its parent; forks and side chats of the watcher get no #78 alert, so they alert it. - Webhook failures log only the host, never the URL. - Due deliveries go four at a time, so a sleeping watcher holds up nothing. - The retry key covers the watcher, so changing it never replays another send. - The environment descriptor is read only when an alert is made. - A failed event stream resubscribes instead of ending alerting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Overnight, a delegated worker's configured model (
claude-opus-5-5) was replaced on every run by a fallback (claude-opus-4-8) after a Claude safeguard notice (model_refusal_fallback). The fallback refused the job for eight hours. The parent's wake only carried the child's reply, with a one-line executed-model note at most, so nothing marked the worker as needing replacement.What changed
A child run that ends now yields a
workerAlertwith reasons and a short notice when any of these hold:model_substituted: the provider reported running a different model from the selected one. This replaces the oldRequested model …; the provider reported running …note.provider_fallback: the run carries a provider safeguard fallback notice. The Claude adapter now recordsfallbackModelon thesystem_noticeformodel_refusal_fallback. For Codex, a reroute already shows up asexecutedModel, so it lands in reason 1. Other adapters have no such signal.usage_limit: the run failed with a provider usage-limit error. The class is set for both Codex 429 "Usage limit reached" and Claude plan and 5-hour limits, so a fleet stalled on one Claude account reports it the same way.withheld_task: the final assistant message holds, refuses, or asks for direct confirmation instead of reporting work. This uses a small first-person regex set inwithholdsTask, with positive and negative cases in the tests.The alert is computed once, when the child's result is finalized, and travels on the existing delegate result path:
workerAlert, kept in the payload JSON, so no migration).Delegated task … [completed] raised a worker alert (child <link>):followed by the notice and the reply. The notification summary says… finished with a worker alert.task_statusexposesworkerAlert.t3_thread_readexposes it on the latest terminal run, so a launcher of at3_thread_launchthread can read it. Only the latest run is judged, so a read loads just one run's replies and notices.delegated_task.remote.complete. With an older peer it judges the run locally from the model and the reply.Nothing acts on the alert automatically. The parent decides whether to replace the worker.
Tradeoffs / not covered
t3_thread_launchhave no completion delivery to their launcher. They expose the field throught3_thread_readbut send no push wake. Adding one would mean a new delivery path, which is out of scope here.withholdsTaskis a heuristic. A genuine blocker report ("I can't proceed without the API key") is flagged too, which is why it is informational only.mcp-tool-useeval was not run.Tests
SubagentProjection.test.ts: alert reasons and notice for a safeguard-swapped, held run (another run's notice ignored), plus awithholdsTasktable of positives and controls.DelegatedCompletionDelivery.test.ts: a finished child with a fallback notice and a held reply gives the parent task aworkerAlertand a wake with the child link. The usage-limit case assertsusage_limit.notification.test.ts: the summary flags alerted tasks.ClaudeAdapterV2.test.ts:model_refusal_fallbacknotices carryfallbackModel.RemoteDelegation.test.ts: the remote result andtask_statuscarry the model-substitution alert.vp run check:changed origin/release/native-0.1.10: format, lint, graphql, typecheck (37 packages) and tests (14 files, 749 tests) pass.knipfails only on findings that are also on the base: 4 unused upstream scripts andINBOX_CAPABILITYinthreadInbox.ts. This change touches neither. The commit skipped the pre-commit hook for that reason.Opus 5.5 in Claude Code (T3 Code harness).
🤖 Generated with Claude Code