feat(tasks): failure escalation + capability-aware agent_list - #93
Open
sandydasari wants to merge 1 commit into
Open
feat(tasks): failure escalation + capability-aware agent_list#93sandydasari wants to merge 1 commit into
sandydasari wants to merge 1 commit into
Conversation
Two halves of the same problem: a mis-scoped task today retries identically with the same assignee on a 5-minute loop forever, and the manager triaging team work has no visibility into who can actually do what. Failure escalation: - New `failures` frontmatter counter, store-managed like `runs` (not in TaskCreate/TaskUpdate input schemas on purpose): park() increments it, success or reassignment resets it. - At MAX_TASK_FAILURES (3) consecutive failures the dispatcher parks with `escalate: true`: the store hands the task off — team manager first, then the creator — as `open` with a 30-minute start_at floor. Open, not blocked: blocked only nudges an already-bound session, and reassignment clears the session, so a blocked handoff would strand. With no distinct target it stays parked with the system comment telling the assignee to re-scope (split via task_plan) instead of retrying as-is. - Reassignment resetting the counter is what prevents instant re-escalation ping-pong; the system comment preserves the history. Capability-aware agent_list: - Each coworker entry now carries `tools`, `skills`, and `mcp_servers` (projected from AgentDefinition in the AgentManager binding), and `query` matches over them — "browser" finds the agent with browser_*. - Manager triage prompt now points at agent_list for capability matching, task_plan for fan-out, and tells managers to re-scope (not re-run) tasks that come back escalated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Two halves of the same problem: (1) a failing task today retries identically with the same assignee on a 5-minute loop forever; (2) the manager triaging team work has no visibility into which coworker can actually do what.
How
Failure escalation
failuresfrontmatter counter, store-managed likeruns(deliberately not in the create/update input schemas):park()increments it; completing or reassigning the task resets it.escalate: true: the store hands the task off — team manager first, then creator — asopenwith a 30-minutestart_atfloor. Open rather than blocked, because reassignment clears the session binding andblockedonly nudges an already-bound session — a blocked handoff would strand invisibly.Capability-aware
agent_listtools,skills, andmcp_servers(projected fromAgentDefinitionin the AgentManager binding);querymatches over them, soquery: "browser"finds the agent withbrowser_*tools.agent_listfor capability matching and tells managers to re-scope, not re-run, tasks that come back escalated.Independent of #92 at the code level (zero shared files/imports; verified by running the full affected suites on this branch alone) — merge order doesn't matter, though prompt text here mentions
task_plan, so both are meant to land.Tests
5 store tests (counting, reset-on-done, manager/creator escalation, no-target), 1 end-to-end dispatcher test (3 failing turns → escalated open task, reset counter, 30-min floor, cleared session), 2
agent_listtests (capability fields, capability-query matching).🤖 Generated with Claude Code