ADR 0129 — Work consolidation: four things a person tracks, and an agent tool surface to match
- Status: Accepted (2026-11-11). Josh approved the direction ("hold and fold into the redesign") and answered Q1–Q3 the same day (see "Decisions taken").
- Date: 2026-11-11
- Deciders: Josh Mabry; protoAgent maintainers
- Implementation: background execution isolation is specified below, not implemented by this documentation slice. The console designSystem spec is approved (2026-11-12, v2); slices follow below.
- Amends: ADR 0127 D5/D6 (pending actions and directives); D6 below also reconciles ADRs 0003, 0053 and 0079. Touches the scheduler, watch, task, goal and decision tool families.
Code citations are origin/main after v0.236.0. (unverified) marks inference not yet confirmed from code.
Context
The console's Work panel has eight sections (apps/web/src/work/sections/): decisions, tasks, background, schedules, watches, goals, directives and activity. Each one mirrors a subsystem. The agent sees the same split as about two dozen tools:
| Concept | Agent tools |
|---|---|
| Schedules | schedule_task, list_schedules, cancel_schedule, wait (tools/scheduler_tools.py) |
| Watches | create_watch, update_watch, clear_watch, list_watches |
| Tasks | task_create, task_list, task_update, task_close |
| Goals | set_goal, update_goal_plan, abandon_goal |
| Decisions | request_decision, withdraw_decision, ask_human |
| Directives | record_directive, list_directives, fulfil_directive, revoke_directive (tools/directive_tools.py) |
| Inbox | check_inbox |
| Background jobs | subagent delegation run in the background (unverified: exact tool names) |
Josh, 2026-11-11: "this entire work/activity panel is a bit much. schedules, tasks, goals, watches, directive. like its just an overload for a user and the agent."
Evidence from the same day:
- A directive that says nothing. mythxEngineer answered a decision ("run the #877 merge queue?") by clicking an option. It then hand-recorded directive
dir-cfd234with the quote"confirmed", which is a word the operator never typed. The console card leads with that quote. What it actually authorizes is in small print. - The decision and the directive duplicate each other. The answered decision already records who approved what, and when.
- A watch contradicted the newer approval. A watch prompt still said "never merge #864–#871" after the operator confirmed merging them. The agent had to notice the conflict and resolve it by itself.
- Raw internal text reached the operator. Board pages, delivered as priority-now inbox items, rendered as "undelivered page" alerts full of internal diagnosis (projectBoard-plugin#735).
- Decisions in a background session went unseen. One raised in
system:activitysat for 70 minutes, and answering it looked frozen (#5099).
Decision
D1 — Four groups in Work, for the operator and the agent alike
Everything the agent is tracking falls into one of four groups. A fifth concern, history, lives outside Work:
- Needs you: decisions, and items that need a human (for example, a stuck delivery). This is the only group that asks for attention.
- Doing now: jobs. Background jobs, the active goal and what used to be tasks are all jobs (Q1).
- Coming up: anything that will run later, whether set off by a time (schedule,
wait) or by a condition (watch). - Your instructions: the operator's standing instructions and approvals.
- What happened is not a Work group (Q3). History is already recorded by telemetry, traces and the activity log, and is read there.
The console's Work panel renders the four groups with one row primitive, using the kind (schedule, watch, goal, job…) as a tag. The in-chat status rail summarizes groups 1–4 with the same vocabulary and the same counts. The visual design is a designSystem spec that Josh approves before any build.
D2 — One "follow up later" primitive
Schedules, watches and wait collapse into one concept: a follow-up with a trigger, either a time or a condition, plus a prompt and an owner chat. The agent gets one tool family (create, list, update, cancel) instead of three. Existing schedule and watch records migrate. The old tool names stay as thin aliases for one release so forks and plugins can move, then they are removed.
D3 — A goal is a job with a finish line
A goal stops being a separate subsystem from the operator's point of view. It shows in Doing now as a job with its completion criteria and its plan. The goal loop's internals (ADR 0073) are unchanged. set_goal and update_goal_plan stay, but their records surface through the same row and inspector as other jobs.
D4 — Approvals come from answers, not agent paraphrase (amends ADR 0127 D6)
- An answered decision is a standing approval, recorded by the server. Its headline is the decision's question and the chosen option, and it links to the decision. The agent does not call
record_directivefor a decision answer. record_directivestays for free-text instructions. The server rejects aquotethat does not appear verbatim in the operator's messages for that turn.- The display leads with what is approved. The headline is the scope. The operator's words show beneath as provenance ("You said 'go for it' · 16:07").
- A directive tied to a bounded job closes itself when the job finishes (Q2). It is recorded as fulfilled with the job as the reason. A directive with no job attached stays in force until it is fulfilled or withdrawn.
D5 — Fewer, clearer tools for the agent
The prompt's capability map groups the tools under the same four headings, and each heading gets one paragraph on when to use it. The target is a third fewer tools in the always-bound set. Aliases do not count toward the target.
D6 — Background job sessions (S0, Refs #5110)
Activity is a provenance feed, not the shared runner for unrelated work. This amends ADR 0003's single Activity checkpoint decision while retaining its authenticated intake, event bus, dedup and storm controls. It refines ADR 0053's background continuation ownership; deliberate interactive same-chat waits remain. It also amends ADR 0079's working-state scope and ADR 0127's D5 scope without weakening compaction fidelity. These are contracts for follow-on implementation, not claims about isolation already present in the runtime.
This is core work, not project_board. Josh's hands-off #5099/#5106 symptom fixes are independent: this chain does not touch, attach to, requeue or depend on them. No release is authorized here; Josh tests Work before the next release.
Source grounding
Paths below are relative to src/, inspected in this checkout.
| Boundary | Current behavior and required correction |
|---|---|
scheduler/interface.py::Job | context_id selects execution; origin_session selects result delivery. They must remain separate. |
scheduler/local.py | jobs.db contains jobs and occurrences. _claim_occurrence commits message identity and a job snapshot before sending and advances the cron slot. _fire selects job.context_id or ACTIVITY_CONTEXT. _remember_task, _reconcile_occurrences and _settle_task preserve accepted handles and distinguish pending/unknown from terminal work. Isolation must preserve this ledger. |
tools/scheduler_tools.py | One-shot schedule_task targets the injected session; cron leaves context null; both stamp origin. wait uses wait:<session> (fallback wait:activity) and yields only on success. Watches persist run_session. |
graph/sdk.py | run_in_session explicitly targets a session and replaces a pending one-shot by stable job ID. react_on defaults explicitly to system:activity with debounce/coalescing. Changing only the null fallback misses it. |
server/a2a.py | _fire_activity_from_inbox uses Activity and a new message ID per attempt. _scheduled_delivery_payload reads origin from the live job and suppresses wait/same-chat duplicate reports. _on_a2a_turn_terminal routes Activity/peer results to the feed but other contexts to chat surfacing. Context changes alone would lose feed routing. |
graph/projection.py | _schedule_scope prefers context over origin and treats other recurring jobs as agent-wide. A dedicated context alone would hide the origin chat's full pending instruction. |
graph/decisions.py, graph/decision_resume.py, operator_api/decision_routes.py | The decision ledger stores a session. Answering uses hitl_resume against that checkpoint, with decision-ID validation under the turn lock. Input-required is not occurrence completion. |
Four identities and stable naming
| Identity | Durable contract |
|---|---|
| Job | Scheduler id plus generation created_at, scoped by instance and agent_name. Recreating an ID creates a new generation; editing or pausing does not. |
| Execution session | job:<execution_uuid>, assigned once and mapped durably to the job generation before claim/send. A2A checkpoint thread is a2a:job:<execution_uuid>. Recurring fires reuse it through restart, edits and pause/resume. Never derive it from title, prompt, origin or cron slot. |
| Occurrence | Preserve (job_id, next_fire, created_at), stable message_id, accepted task_id, and immutable dispatch-context snapshot. Each fire is distinct even when it reuses the job session. |
| Origin chat | Nullable origin_session is provenance/result destination, never an implicit request to execute in that chat. Closing/deleting it does not redirect execution. |
Human labels are Scheduled job: <title> or Inbox: <source>, with a short job/item ID when needed to distinguish rows. Renaming a label never renames its context; UUIDs are not primary Work headlines.
Null and explicit system:activity background targets allocate isolated owners. Explicit non-Activity targets remain deliberate continuations: interactive wait, same-chat one-shot schedule_task, goal/watch wakes and run_in_session(chat, …) retain their context. react_on keeps its signature, debounce and stable pending replacement key; its Activity default requests an isolated background owner. Replacement may replace pending work only: retain an accepted predecessor's occurrence and queue its replacement behind the same owner, with a distinct generation/claim. Unsupported remote backends must report that they cannot honor isolation, not silently fall back to Activity; existing signatures remain usable.
Wait/watch continuations persist an explicit root-job-generation and execution owner, plus parent occurrence when known. Their trigger identity is separate from their owner's session. A background wait uses wait:<execution_session>; two jobs from one chat cannot replace each other's waits. A watch's run_session and owner point to that same execution session; hook-only watches remain hook-only. Origin provenance and fences propagate. Read ownership from injected graph state, not the empty tool-body tracing contextvar. ADR 0053's interactive one-pending-wait per chat, full conversation continuity, success-only yield and resumed-chat delivery remain intact.
Serialization, lifecycle and retention
At most one active invocation owns an execution session. Hold ownership across input-required, unknown acceptance and outstanding wait/watch continuations, even when the initial A2A turn ends after yielding. The owner's continuation can enter after its predecessor yields for it; a new independent cron occurrence cannot. Decisions resume the existing interrupt under its lock, not a new prompt. Other jobs remain runnable.
Do not queue every missed cron tick. While held, keep the next due slot; when released, claim at most one due occurrence and compute the next slot after claim time, matching existing coalescing behavior. Preserve startup stale-fire, TTL, max-fires, backoff and pause policies, except none may drop unresolved work. Migration itself never recomputes times. Terminal settlement updates counters exactly once; yield or a pending decision does not mean the logical job finished.
Distinguish terminal turn, terminal occurrence and finished job. Recurring jobs remain live between fires; one-shot roots remain unfinished while continuations exist. Cancellation/expiry stops future triggers but cannot erase accepted work or imply its cancellation succeeded. Retain an owner record after deletion of the one-shot scheduling row.
Checkpoint, task handle, owner mapping, occurrence snapshot and required archive history are pinned beyond normal TTL while any occurrence is unresolved, decision resolution unconsumed, or continuation outstanding. Failed resume delivery and missing task reads retain those pins. Origin-chat archival is independent. Only after all references resolve may existing retention policies archive the session; keep identity/settlement tombstones as long as replay/dedup can reference them. Never reuse retired execution UUIDs. Archival never authorizes resume or resend.
Idempotent migration and restart
Run versioned migration before polling, inbox dispatch and reactive hooks. Use guarded additive schema changes and transactional owner assignment in jobs.db. Checkpoint, task and decision stores are not one transaction: journal migration stages durably and resume incomplete stages on boot; exclude older dispatch writers during migration. Do not migrate by cancel/re-add, checkpoint copy or replay.
- Inventory jobs and orphan occurrence snapshots, accepted tasks, legacy waits/watches and parked decisions. Allocate one mapping per independent job generation targeting null or exactly
system:activity. Keep future routing separate from original accepted dispatch context. Preserve explicit non-Activity targets and origins. Do not copy shared Activity history into new sessions. - Preserve occurrence keys,
message_id,task_id,job_snapshot,expected_next, state and diagnostics. Preserve job IDs,created_at,next_fire,last_fire, enabled state, fence, TTL/max-fires, counters and outcome timestamps. Only routing/migration metadata changes; a second migration is a no-op. New routing applies to the next unaccepted invocation, never an accepted Activity task. - Reconcile accepted work through its original task handle/checkpoint. Claims without recoverable handles stay quarantined; missing/failed GetTask reads never authorize resend. Only positive existing retryable/non-acceptance evidence permits normal retries. Settlement remains transactional and generation-guarded: an old task cannot delete or increment its replacement. Resolve legacy accepted work before admitting its owner's new independent fire.
- For
wait:system:activityand null-originwait:activity, bind to a job only when durable creation/occurrence/checkpoint evidence identifies exactly one owner. Prompt wording, timestamps, origin chat or last-seen job are insufficient. A proven, unaccepted wait may target that owner with explicit continuation state; retain its old row/key as an alias until settlement instead of resetting occurrence identity. Accepted waits reconcile at their original target. - Without ownership evidence, preserve the wait as a held legacy continuation with its original due time/prompt, visible through existing Needs you delivery handling. Never drop it, guess a new owner or auto-fire into shared Activity. An operator may bind/rearm positively unaccepted work or cancel it. Unknown acceptance requires reconciliation first; rearming cannot bypass it. This is visible unresolved work, not a claim to reconstruct unavailable ownership.
- Legacy parked decisions retain ledger IDs, session, task and checkpoint interrupt. Resume the matching decision in place using the existing guarded path; never clone a checkpoint or resubmit the original prompt. Retain a restricted legacy drain lane for these resumes, admitting no new independent Activity fires. If records disagree with the live interrupt, only the matching record may resume; expose others as unresolved. A missing checkpoint is a recovery item, not an answered decision. Follow-up waits from this drain need proven ownership or the same hold policy.
Uncertainty therefore stays durably visible rather than losing pending work or duplicating accepted work. This does not promise exactly-once external tool side effects; it preserves the existing no-blind-resend acceptance boundary.
Job-scoped state, compaction and attribution
ADR 0079/0127 working-state now uses explicit execution ownership. A job sees its own goal/plan, tasks, directives, pending waits/watches and current occurrence, with full-instruction caps, cancellation labels and [FIRING NOW] retained. Other jobs get bounded summaries/counts, not their actionable instructions as this job's commitments. Origin chats still see their own scheduled actions in full: replace context-or-origin precedence with separate membership tests. Plugin work providers remain projections, not replicated state; agent-wide summaries must not imply ownership of unrelated commitments.
ADR 0127's single engine, archive-first ordering, whole-span fold, intact tool pairs, verbatim operator messages, continuation sections and failure behavior remain. Auto/manual/overflow compaction use the job checkpoint and archive namespace. Repeated compaction preserves its approvals, stop conditions and continuations without importing sibling or origin-chat histories. Keep configured system guidance and explicitly scoped directives; consult the authoritative ledger for revocation. Wake prompts never become operator authorization. Tool fences survive scheduling/resume. Conversation isolation is not a filesystem sandbox.
Fire/result/decision/feed records carry execution session, job generation, occurrence/message/task identity and nullable origin provenance. Independently fired inbox work persists inbox:<item-id> → execution UUID and acceptance record before send; retries reuse message identity and accepted task handle. Distinct items from one source get distinct sessions. Source names and dedup windows are not execution IDs. HTTP success alone is not delivery evidence; uncertain sends are reconciled, not retried with new IDs. Existing next/later pulls and deliver: thread information-only delivery do not create independent runners.
Activity routes by origin/ownership, not context equality, and deep-links to the actual execution/result. Preserve legacy feed history. Scheduled reports retain origin delivery and first-card/subsequent-chip behavior; same-chat waits retain duplicate-report suppression. Snapshot attribution before one-shot deletion. Deduplicate feed/report retries by occurrence/task independently of invocation; missing origin or failed feed writes never trigger another execution.
Reuse the approved Work spec: all-chat Work, origin-chat meta/This chat badge, shared counts and the existing fleet-wide Needs you marker. Job-session decisions remain visible without an origin chat; answers route to the execution checkpoint, not displayed origin. Not-started jobs stay Coming up; started blocked jobs stay Doing now with their decision in Needs you. Finished items leave Work; history stays Activity/telemetry. No new layout, group, marker or inspector design is authorized here.
Exact follow-on tests
These are required future tests, not coverage claimed by this documentation slice. Use temporary real stores and deterministic clocks/transport barriers for restart and concurrency; consumer payload fixtures alone do not prove native isolation.
| Suites | Required cases and assertions |
|---|---|
tests/test_scheduler_local.py | Two null and two explicit Activity jobs get distinct sessions; repeat/restart/edit/pause retain them; recreated IDs get new generations. Pending/unknown/input-required blocks only its owner. Wait continuation runs while the next cron stays held; release coalesces missed ticks once. |
tests/test_scheduler_local.py, tests/test_scheduler_ttl.py | Migrate twice and crash after every journal stage. Compare preserved columns, keys, snapshots and handles byte-for-byte. Include accepted Activity tasks, orphan snapshots, retryable/unknown sends, replacement jobs and duplicate terminal settlement. No extra SendMessage, reset counter/next_fire or lost pending work. Missing GetTask stays held; cancel/TTL cannot purge unresolved work. |
tests/test_scheduler_tools.py, tests/test_sdk_scheduler.py, tests/test_sdk_react_on.py | Interactive wait/one-shot retains chat history and one pending key; background waits cannot replace siblings. Watches retain owner/fence. Null and explicit SDK Activity isolate; explicit chat/goal targets, debounce and pending replacement still work. Accepted replacement retains its predecessor. Unsupported backend fails visibly. |
tests/test_decision_needed.py, tests/test_decision_expiry.py | Two jobs park independently; answer/dismiss/expiry affects only the selected checkpoint. Legacy matching interrupt resumes in place once; foreign/missing interrupts cannot resume another job. Unattributed wait is held; proven unaccepted wait rebinds without key reset; accepted wait never replays. Restart retains all unresolved references. |
tests/test_inbox.py | Same-source now-items get distinct contexts; duplicate delivery of one item reuses durable identity. Crash before/after acceptance, transport loss and missing task evidence do not create another invocation. Pull tiers and thread delivery stay unchanged. |
tests/test_working_state.py, tests/test_working_state_wiring.py, tests/test_compaction_fidelity.py, tests/test_system_thread_compaction.py | Put sentinels in actual live origin, Activity and sibling histories. Inspect native provider-bound messages before and after a real tool execution: only explicit job inputs/own history survive. Verify configured guidance, effective fence bindings, own full pending instructions, origin visibility and current-fire marker. Run auto/manual/overflow compaction twice; own verbatim approvals/stop rules survive, sibling sentinels do not. Verify identity/receipt readback from durable stores. |
tests/test_activity_emit.py, tests/test_activity_feed.py, tests/test_scheduler_failed_turn_wire.py | Dedicated-context success/failure reaches feed and origin once after one-shot deletion, reconnect and failed-delivery retry. Actual context/task links and collapse counts persist; same-chat wait has no duplicate report. Missing origin does not lose history. |
apps/web/src/work/workGroups.test.ts, apps/web/src/decisions/entrypoints.test.tsx, apps/web/e2e/decision-needed.spec.ts, apps/web/e2e/chat-decision-resume-live.spec.ts | Existing groups/counts, origin labels and fleet marker include isolated and legacy-held decisions. Answer resumes only the selected execution while another job progresses. Finished items leave Work; Activity remains history. Run these relevant browser specs and Josh's desktop Work validation before release. |
Implement durable identity/migration first, then scheduler/SDK/inbox dispatch and continuation ownership, then state/compaction/result/decision attribution with integration validation. Background-session S0 is separate from the console slice numbering below.
Amendment (ADR 0135 D9, #5545). Each job still runs in its own job: session, and Activity stays the provenance feed. What changes is where results are shown. Each instance has one Home conversation: an ordinary operator chat with a stable id, pinned in the console. A job with no origin_session shows its results in Home. Owner notices (notify, question, review) also post an entry in Home. Home entries are written into Home's own thread as reference messages, so a reply in Home sees them. Showing a result in Home never runs the job there and never gives the job Home's context. A job created from another chat still shows its results in that chat, unless the operator moves it to Home.
Amendment — Batched inbox recovery turns (2026-11-22, Refs #5519)
Job. When several inbox items arrive at once, help the agent read them in one turn so it replies once, without breaking per-item retry deduplication.
Scope. This is the design contract for slice 2 (bd-qcxtl), not an implementation claim. It supersedes D6's distinct-session-per-item rule and same-source test expectation only for the retry-when-free / now-recovery pass in src/server/stores.py. Today InboxStore.claim_now_recovery_batch in src/inbox/store.py claims at most eight items and the pass calls STATE.inbox_now_delivery (src/server/a2a.py::_fire_activity_from_inbox) once per item. The console's direct new-now-post path in src/operator_api/console_handlers.py is out of scope. Pull and thread delivery, eligibility, age limits, retry budgets and claim leases stay intact.
Grouping. Partition unbound eligible items claimed in one pass by exact source and priority: priority does split groups, so now and next are not mixed. Also split on origin_session (null and empty mean no origin) and requester provenance (origin_meta), so one execution cannot arbitrarily inherit another member's chat or requester. Do not accumulate across passes. Process groups in first-member claim order. A group of one keeps today's per-item identity allocation and wire shape unchanged, including inbox_id, text and creation-time metadata. Existing per-item execution bindings remain singleton deliveries; never overwrite them to batch.
For two or more members, send one self-A2A SendMessage with returnImmediately: true. Include every member's full text, separated and labelled by item id in ascending numeric id order, with each member's queued timestamp and late-delivery notice. Ask for one response to the group.
Batch identity. Freeze membership before sending. In one store transaction, revalidate each member's claim and bind every member's inbox_executions row to the same context and message id. Abort the entire binding if any claim changed or any member acquired a binding. Persist the full member list, dispatch snapshot and generation with the binding, so a partial later claim cannot redefine it. There remains one execution row per item_id; several rows may name one batch.
Use UUIDv5 with NAMESPACE_URL and a canonical name: compact JSON of ["protoagent/inbox-batch/v1", store_namespace, sorted_member_ids, generation]. store_namespace is a UUID allocated once and persisted in this inbox database; member ids are integers sorted ascending without duplicates. The context is job: plus UUIDv5 of that name prefixed with "context:"; the message id is UUIDv5 of that name prefixed with "message:". Generation starts at zero for each member set. Retries reuse the persisted generation. Proven terminal failure retires it: retain a durable retirement tombstone and atomically advance the set's generation before a fresh invocation, so unchanged members cannot regenerate a dead task's identity. Claim time, claim order and source names are not identity inputs.
Retry dedup and differing sets. A retry of the same frozen member set presents the same (contextId, messageId) and joins the accepted A2A turn. Acceptance is for the whole message; a partly accepted batch means partial local bookkeeping, never partial acceptance of its payload. Reconcile bindings before forming new groups:
- Already-delivered members are not re-sent. Members with an accepted task handle or
recovery_accepted_atcomplete local marking without a fire. - A member bound to an accepted batch identity is never re-batched into a new identity. Resolve the original full membership and task even if only some members are claimed this pass. New unbound members form separate groups: accepted
{A, B}followed by claimed{B, C}completes B against the original task and delivers C separately. - Uncertain sends retain their frozen binding too. Reconcile the original identity; a transport retry uses the original full snapshot and identity, so A2A dedup joins the same turn. Never send a reduced
{B}or enlarged{A, B, C}under a new identity while{A, B}is unresolved. Known acceptance switches to completion-only reconciliation. A delivered member alone does not prove batch acceptance (a pull consumer may have delivered it); defer the remaining members with evidence and retain the binding, without payload replay. Missing/unreadable task evidence or a missing member row does not prove failure: keep the binding and defer with evidence, rather than inventing a smaller batch. Pin unresolved membership and snapshots across pruning.
Per-member settlement. On acceptance, record the same task id on every member's execution row and mark every member delivered. Persist batch acceptance before member completion; completion is restartable. A delivered-mark failure preserves that member's durable recovery_accepted_at completion marker and claim. Later passes finish marking without a fire, including while busy or beyond the ordinary age/attempt limit. Repair partial member acceptance writes from the batch's acceptance record; they never authorize re-batching.
On refusal, exception or cancellation, restore every affected member with its own restore_recovery_failure(item_id, ..., claimed_at=member_claim) and release the unprocessed claimed tail. Never substitute another member's claim or reopen an item delivered by a concurrent owner. A busy bail before sending restores each skipped member with refund_attempt=True; an attempted send keeps each member's attempt charge. Completion-only members still finish while busy. Uncertain sends retain the execution binding.
A terminal failed/rejected/canceled dedup echo retires every member's identity as one batch settlement and restores each still-owned claim. An accepted turn that later fails restores every member to pending and retires the entire batch, guarded by accepted-task ownership rather than the undelivered-claim guard. Track all members in the task watch and durable recovery record. Preserve the early-terminal / owed-restore ordering per member: settle its owed restore after its delivered mark, including the recovery_accepted_at completion path, so a late success write cannot bury a failure. Settlement is idempotent and cannot clear a newer binding or claim. HTTP failure, lost response or missing task evidence alone never retires an identity. This preserves retry dedup, not exactly-once external side effects; D7's interrupted-task policy still applies.
Wire provenance and StormGuard. Batch message metadata contains origin: "inbox", inbox_source, the group's priority, and inbox_ids (the sorted full member list). For existing singular attribution consumers, inbox_id is the lowest member id and created_at is that member's queued time; inbox_ids remains authoritative for full batch membership. The durable member-to-context mappings let origin_for_context resolve the common origin; request attribution must expose the full membership while keeping singleton attribution unchanged. Activity uses inbox origin/source and the shared task/context, with member ids for traceability: one turn yields one result, not a report per member. No-origin routing stays unchanged. StormGuard counts one batched fire as one fire, under the existing eight-fires-per-60- seconds limit. Denial restores all group claims; completion-only reconciliation consumes no fire.
Required slice-2 verification. Use real temporary stores to cover grouping, singleton compatibility, sorted deterministic identity, retirement and a fresh generation, same-set retry and differing-set reconciliation. Cover lost acceptance responses, crashes between member writes, missing task/member evidence, busy-bail refunds, cancellation, StormGuard denial, accepted-mark completion, terminal dedup echoes and early/late failures for every member. Verify common origin/requester attribution and one Activity result, with unchanged console direct-post, pull and thread-delivery paths. These are future implementation tests, not coverage claimed by this documentation slice.
D7 — A turn interrupted by a restart: resume what's safe, ask about the rest (Josh, 2026-11-12)
Problem. When the server stops mid-turn (SIGTERM, crash, desktop relaunch), a2a_impl/stores.py::reconcile_interrupted_tasks marks the task failed ("Task interrupted by an agent restart; its runner did not survive."). The scheduler then logs reconciliation unavailable; not resending and never runs it again. That is at-most-once, and it is right for side effects, but it silently loses work. The worst case is a background wait/watch continuation: it is the agent's only way back into a loop, so dropping it stops a merge queue with no one told. This happened to the whole fleet on 2026-11-12, when the desktop sidecar was SIGTERMed and 10 members spun down, and the v0.237 stress harness reproduces it (scripts/stress, restart scenario).
Decision. On boot, classify every task interrupted by the restart from its LangGraph checkpoint, the source of truth for what completed, before marking anything failed. Then apply this policy. It replaces blanket failed for scheduler-owned work (job sessions, waits, watches, inbox fires). Interactive chat turns keep today's behavior: the operator sees the interruption and resends.
| Interruption point (from the checkpoint) | Kind of work | Action |
|---|---|---|
| Between steps, or during a model call: every tool call in the last AI message has its ToolMessage | any | Resume automatically from the checkpoint. Completed steps aren't repeated. |
| During a tool call: an AI message has tool calls without results | wait: / watch continuation | Resume, and report the uncertain call to the model as interrupted ("this tool call was interrupted by a restart; its effect is unknown, so verify before repeating"). The agent's loop continues. |
| During a tool call | any other job occurrence | Ask in Needs you: "<Job> was interrupted by a restart after <N> steps. Last action: <tool>(<short args>), and its effect is unknown." Options: Resume (continue with the uncertain call reported as interrupted), Re-run (fresh turn from the job's prompt), Drop. Neutral tone, never an error. |
| any | a recurring job's occurrence | Skip the interrupted occurrence (record it as interrupted, not failed). The next scheduled occurrence runs as usual. If it stopped mid-tool-call, also raise the Needs you item, without Re-run. |
Guards.
- At most one automatic resume per occurrence. A second interruption of the same occurrence (for example, a job whose turn crashes the server) goes to Needs you instead of looping. Count it on the occurrence row, in the same transaction as the claim.
- Never resend without positive evidence. D6 still holds: an accepted task is resumed against its own checkpoint thread and task handle. It is never a new prompt, and never a re-send of the original message. Re-run in the Needs you item is the only path that starts a fresh turn, and only the operator can pick it.
- Ownership. The resume runs under the occurrence's execution-session lock (D6 serialization), before the owner admits any new independent fire.
- Visibility. Every auto-resume emits an Activity entry ("Resumed <job> after a restart (step N)"), so an automatic recovery is never silent. The Needs you item links to that job's trace.
- No checkpoint. If the checkpoint is missing or unreadable, raise the Needs you item with Re-run and Drop only.
Not covered. This doesn't make external side effects exactly-once. A tool that ran but whose result was never written stays uncertain, and the policy makes that uncertainty visible: to the model on resume, or to the operator.
D8 — A "waiting on you" item is answered where it is shown (Josh, 2026-11-14)
Problem. A task the agent parks on the operator (waiting, Q1) carries the session_id of the conversation it was created in. Clicking the row in Needs you skips the detail and calls openSourceChat, which only works if that session has durable chat turns. Often it doesn't: the agent created the task in an agent-to-agent conversation (agent-browser-handoff-2026-11-09), a background job (job:3ab48335…), or a chat that was later deleted. On protoEngineer on 2026-11-14, all four Needs you tasks pointed at sessions with zero turns. The operator saw "Couldn't open source chat. Try again when the agent is connected," the agent was connected, and there was no other way to answer.
Decision. The item itself is where the operator answers. The source chat is context, offered only when it exists.
- Opening a waiting task shows its detail, never an automatic jump to a chat. The detail leads with the ask (what the agent needs from the operator), then the links (issue or PR, as links), who is waiting and since when, then the description.
- The ask is its own field. A task carries an optional short
ask, set by the agent when it parks the task (task_update(status="waiting", ask=…)). The tool requires an ask when the status iswaiting. Older tasks fall back to the first line of the description. - Actions that don't depend on the source chat:
- Reply. The operator types an answer in the detail. If the source chat has durable turns, the reply is sent there. Otherwise it starts a new chat titled "Re: <task title>" (server-held, ADR 0130 S6, so every device sees it) whose first message quotes the task and the ask. The task's
session_idthen points at that chat, so the next Open chat works. The task leaveswaiting(back toopen) once the reply is sent. - Done, with an optional reason: closes the task.
- Dismiss, with an optional reason: closes the task as not needed.
- The agent is told the outcome. Closing or dismissing a waiting task from the console queues an agent-owned inbox item (priority
next, never operator-class) naming the task, the action and the reason.
- Reply. The operator types an answer in the detail. If the source chat has durable turns, the reply is sent there. Otherwise it starts a new chat titled "Re: <task title>" (server-held, ADR 0130 S6, so every device sees it) whose first message quotes the task and the ask. The task's
- Open chat only when there is one. The action appears only when the source session has durable turns. Otherwise the detail says where the task started: "Started in an agent-to-agent conversation", "Started by a background job", or "Its chat was deleted". There's no error toast.
- Honest failure copy. If an Open chat still fails, the toast says the chat isn't available. It never says to retry when the agent is connected.
Decisions keep their own inline answers (D4). The chat rail's Needs you section follows the same rules as the Work view.
D9 — A task nobody is driving wakes the agent (Josh, 2026-11-14)
Problem. Task status is only a label; nothing checks that the work behind it is actually moving. On 2026-11-14 protoEngineer left task-59 in_progress with no linked work running, no schedule, no watch and no background job — nothing that would ever bring the agent back to it. The Work view still showed it under "Doing now" (apps/web/src/work/tone.ts groupFor: in_progress → doing-now unconditionally), so Josh believed the agent was working on it. It wasn't, and it never would be. The one existing signal — the stale line gated by STALE_TASK_MS in tone.ts — only appears after 24 h and is UI-only; it changes a label but wakes no one. Separately, protoAgent#5270: a recurring follow-up job reported the same parked work about 17 times in one afternoon while it waited on an operator decision, because "no change" was not a reason to slow down.
Decision. A task's status is a claim the server verifies. An in_progress task with nothing driving it is woken; a follow-up that keeps reporting no change while it waits on a human backs off.
The driver test. A task is driven when at least one of these holds:
- it has a linked item that is not yet resolved — a board card, PR, scheduler job or directive, from the task's existing
links; - a pending scheduler job (one-shot or
wait) or an active watch belongs to the task'ssession_id; - a background job or delegation is running for that session;
- a turn is running in that session.
One shared server function answers "is this task driven?", and every consumer below (the stall check, the Work view status and the
task_updatewarning) calls that same function, so they can never disagree.- it has a linked item that is not yet resolved — a board card, PR, scheduler job or directive, from the task's existing
Stall check. On the task link sweep's cadence (every 5 minutes), a task whose status is
in_progress, that is not driven, and whoseupdated_atis older than 30 minutes is stalled. The server tracks a nudge count on the task (the number of nudges sent since its last real update). Each sweep that finds the task still stalled queues one agent-owned inbox item (prioritynext, never operator-class, sourcetask-stall) and increments the count. The inbox item is deduplicated on task id +updated_at+ that nudge count, so a sweep never double-queues the same nudge (for example after a restart that re-runs the sweep for a tick it already handled), but the next sweep still queues the next nudge. A real update changesupdated_atand resets the count, ending the lineage, so a task that actually moved is never nudged for a state it has already left.The wake turn must reconcile status. The nudge text tells the agent to do exactly one of: act on it now; link the work that drives it; schedule a follow-up (
wait/schedule_task); setwaitingwith an ask; setdeferred; or close it. Re-stating progress is not one of the options — a status with nothing behind it is the thing being corrected.Nudge cap. Once the nudge count from item 2 reaches 3 and the task is still stalled, the next sweep moves the task to
waitinginstead of queuing a fourth nudge, with the ask "Stalled: no progress after 3 reminders — continue, defer or close?", so it surfaces in Needs you marked stalled rather than looping forever in the agent's inbox. Any real update to the task resets the count to zero (item 2), so a task that moves and later stalls again gets the full three nudges afresh.Work view status. "Doing now" shows a task as active only when it is driven (same driver test, evaluated client-side against the Work data). An undriven
in_progresstask reads "in progress · idle Nm" (minutes since its last update); a stalled one reads "stalled". The task stays in the Doing now group — only the label changes, so the operator sees at a glance which of the "doing now" rows are really moving. The 24 h stale line (STALE_TASK_MS) remains for very old tasks.task_updatewarning. Setting a taskin_progresswhen it is not driven still succeeds — the agent may be about to link the work — but the tool result adds one line telling the agent that nothing is driving the task and naming the fix: link the work, schedule a follow-up, or setwaiting.Follow-up backoff (#5270). A recurring scheduler job whose consecutive runs report no change (the existing repeated-result /
NO_UPDATEdetection insrc/server/a2a.py) and whose origin chat has a task inwaitingor a pending decision backs off: after 2 unchanged runs it fires at most hourly, and it returns to its normal cadence as soon as a run reports something new or the waiting task / decision is answered. One "still waiting on you" card is posted at the moment it backs off; the unchanged runs after that post nothing. This is what stops the ~17-reports-an-afternoon loop.
Defaults. 30 min idle threshold, 5 min sweep cadence, 3 nudges before waiting, 2 unchanged runs before backoff, hourly backoff cadence. These are written as constants, not settings, for now.
Not covered. This does not change what a running turn does; it only wakes a task that has no turn, schedule, watch, job or unresolved link behind it. The driver test is a point-in-time check on durable state, so a task that is driven again (a new link, a scheduled follow-up) is simply not stalled on the next sweep. The nudge dedup (item 2) keys on the nudge count as well as updated_at, so an unchanged task is woken once per sweep up to the cap of three and then parked in waiting (item 4) — never a fourth time, and never twice for the same sweep tick.
Consequences
- Good: one mental model for operator and agent. Fewer wrong-tool calls and fewer contradictory records (a watch versus an approval). Work becomes scannable, and decisions stop hiding in background sessions.
- Cost: migrating schedule and watch records. A release cycle of aliases. Plugins that register Work sections (
registerWorkSection) need to choose a group (unverified: which plugins do). - Risk: merging schedule and watch semantics could lose a capability one of them has (for example, a watch's
checkfunction). S1 audits both before any code change.
Slices
- S0: the designSystem spec and preview for the four-group Work panel plus the rail. Josh approves. The held Activity cards (bd-ek2ye, bd-tn5g6, bd-0ohpa, bd-50ejc) are replaced by S0's build cards.
- S1: audit schedule, watch and
wait(fields, triggers, delivery, persistence). Write the follow-up record shape and the migration. - S2: console. Four groups on today's data, mapped client-side, with no backend dependency. Remove the activity section from Work.
- S2b: fold tasks into jobs. Migrate
task_*records to jobs and keeptask_*as aliases for one release. - S3: D4 approvals. Server-recorded directives from decision answers, quote verification, and the scope-first display.
- S4: D2 follow-up primitive, plus aliases and the migration.
- S5: D5 prompt capability map and tool-count reduction. Remove the aliases one release after S4.
- S6 (D7): classify interrupted tasks from their checkpoint on boot; auto-resume the safe cases with the one-retry cap; skip interrupted recurring occurrences. S7 (D7): the Needs you recovery item (Resume / Re-run / Drop) and the Activity entry for each auto-resume.
- S8 (D8): server: the task
askfield,session_idupdatable,task_updaterequiring an ask forwaiting, and the agent-owned outcome inbox item on a console close or dismiss. S9 (D8): console: waiting tasks open their detail; ask, links, Reply / Done / Dismiss; Open chat only when the source has turns; provenance line and honest copy. S10 (D8): the chat rail's Needs you section follows S9. - S11 (D9): server. The shared driver test (one function every consumer calls), and the 5-minute stall check on the task link sweep that queues the
task-stallinbox nudge (prioritynext, deduped on task id +updated_at+ the per-task nudge count so each sweep queues the next nudge rather than a duplicate), increments that count, and once it reaches 3 moves the task towaitingwith the stalled ask. S12 (D9): console. "Doing now" reads "in progress · idle Nm" / "stalled" for an undrivenin_progresstask using the same driver test client-side; the row stays in the group; the 24 h stale line stays. S13 (D9): thetask_updatewarning line when a task is setin_progresswhile undriven. S14 (D9, #5270): the follow-up backoff — a recurring job with unchanged runs and a waiting task / pending decision in its origin chat fires at most hourly after 2 unchanged runs, posts one "still waiting on you" card at the moment it backs off, and resumes normal cadence on the next changed run or when the wait is answered.
Independent fixes in flight that this ADR keeps: #5099 (a decision answer returns as soon as it is consumed) and projectBoard-plugin#735 (human page text, and pages retire when their card does).
Decisions taken (Josh, 2026-11-11)
Interrupted turns (D7, 2026-11-12): resume what's safe, ask about the rest. Josh chose the hybrid after weighing at-most-once, at-least-once, checkpoint resume and asking in Needs you.
Group names: Needs you · Doing now · Coming up · Your instructions. The rail chip for instructions reads "Instructions N".
Not-started jobs don't count in Doing now. They show under Coming up.
Interim decision link: until D4's server-recorded approvals land, an instruction links to a decision when that decision was answered within the 2 minutes before the instruction was recorded.
The design is the designSystem spec (docs/design/work-consolidation.md), approved 2026-11-11.
Q1, tasks: folded into jobs. "tasks get folded into jobs."
Q2, approvals tied to a job: close themselves when the job finishes. "anything tied to a finished job should close itself."
Q3, What happened: not in Work. "what happened doesnt need to be in work at all, thats what we have telemetry and such for and that should already be tracked elsewhere."