Skip to content

Taskbase — Attention: Notices and the "Needs attention" Page

Kind: reference

When agent work needs a person, Taskbase records an attention event, posts a one-line notice with a link to the organization's Mattermost channel, and lists the event on the phone-first "Needs attention" page. There the person handles an item in one of two ways: choose one of its options and confirm, or discuss it with an agent (Two ways to handle an item). Both act with the person's own token. Mattermost only tells people to look; every action happens in Taskbase. Design: ADR-0010, and for resolving an item by chat, ADR-0015.

sequenceDiagram
    participant API as Taskbase API
    participant DB as Taskbase database
    participant MM as Mattermost
    participant P as Person
    API->>DB: state change and its event, in one transaction
    API->>DB: notifier claims due deliveries
    API->>MM: incoming webhook, mentions, one line and a link
    MM-->>P: push notification from the Mattermost app
    P->>API: opens /attention/event in the browser, signed in
    P->>API: chooses an option and confirms, or discusses with an agent
Part Code (Taskbase repository)
Events (outbox), GET /api/attention, retention api/internal/attention/
Mattermost settings and the notifier api/internal/notice/
POST /api/tasks/{id}/comments api/internal/comment/
Context header, references, groups and waits_on api/internal/attention/ (context.go, groups.go)
Requeue, requeue-after, the group requeue and the other actions as services, used by choose and by an agent's plan api/internal/attentionaction/, api/internal/task/service.go
An item's options and the choose action api/internal/attention/options.go, api/internal/attentionaction/choose.go
A task's pull request and CI state api/internal/pullrequest/
Discuss with an agent (sessions about a task) api/internal/session/ (plan.go, execute.go), api/internal/sessionframe/, ui/src/AttentionSession.jsx, ui/src/attentionSessions.js
The page, its actions and the user menu's open-item count ui/src/App.jsx (AttentionView, AttentionItem, AttentionActions), ui/src/attention.js
The page on a phone: one card per item ui/src/AttentionCards.jsx, ui/src/attention.js (cardKind, cardChoices, cardQuestion, checklistSteps, doneOption, staleItem)
Organization settings card ui/src/App.jsx (OrganizationMattermost)
Triage tasks for the operator and manager roles, reason classes api/internal/triage/, api/internal/attention/class.go, api/internal/task/triage.go, api/internal/task/triage_pg.go

What raises an event

Events live in the notifications table (Database Schema). Each is written in the same transaction as the state change that causes it, so a crash never loses or invents one.

Kind Raised when Dedupe key
task.needs_attention A task enters needs_attention, with a reason (below). Two reasons are raised on a person's task instead, whose dispatch_state is NULL: blocking_agent_work and decision_needed (Person tasks) task + reason
task.question A finished run's digest has open_questions and its task now waits for a person (not done, not queued). The payload holds the first question task + run
runner.offline A runner's last_seen_at is more than 10 minutes old. Raised by the lease sweep (every 15 s); runners not seen for 24 hours (runner.RecentlySeenWindow) are left alone, so a long-retired runner raises nothing runner
runner.adapter_held A runner reports an adapter held with reason auth_failure (its login is broken), at registration or in a heartbeat runner + adapter
runner.update_failed A self runner's heartbeat reports update_error for the version that is its effective target (its own target_version, else the global default). An image runner has no effective target and never raises this event runner + version

Reasons of task.needs_attention:

Reason Shown as Cause
run_failed Run failed An implementation or review run failed
run_cancelled Run cancelled A run was cancelled
run_lost Run lost A run finished as lost and parked the task
usage_limit_exhausted Usage-limit retries exhausted A run failed with reason usage_limit and parked the task
runner_restarts_exhausted Runner-restart retries exhausted A run finished with reason runner_restart (failed or cancelled because its runner shut down or crashed) and the task's last three runs all ended with it, so the task was parked (ADR-0011 decision 3)
review_blocked Review blocked A review returned blocked; the reviewer's summary is the event's detail. Also a second merge_handoff in a row, with the detail "the merge run ended without merging the approved pull request" (Merge hand-off)
review_rounds_exhausted Review rounds exhausted changes_requested at the project's review_max_rounds; an implementation run succeeded with a reviewable PR after the last round, or the stuck-review sweep moved a task to Review whose rounds are used up; or the queue sweep found a review queued in Review with its rounds used up. In the last three cases the task waits in Review, the detail and dispatch_reason are the requeue's rounds message, and the queue sweep requeues the task once the project's rounds are raised (Taskbase #1634)
review_out_of_date Keeps falling behind its base A third out_of_date review verdict in a row; the detail suggests running related tasks one after another
no_pull_request Finished without a pull request An implementation run succeeded without a PR in a reviewed project, or the queue sweep found a review queued in Review with no implementation run that has a reviewable PR; the detail is then the requeue's no-PR message
investigation_only Investigation only, nothing to review yet An implementation run succeeded with a reviewable PR in a project with a review persona and its digest set investigation_only (Investigation-only runs). No review starts and no review round is used; the task is parked in Blocked and the PR stays linked on the run and the item. A work reason with the standard options Try again and Park it
pull_request_unreviewed Pull request left without a reviewer The stuck-review sweep found a task left dispatched outside Review after its implementation run opened a pull request, in a project with no reviewer. It moves the task to Review and parks it; the event links the PR and its detail says to review and merge it. In a project with a reviewer whose rounds are used up, the sweep raises review_rounds_exhausted instead
pull_request_unlinked Pull request in an unlinked repository An implementation run recorded a Gitea PR outside the organization's linked repositories. The task is parked in Blocked even when agent review is off. The event retains the PR link and its detail explains which repository is unlinked, e.g. "the pull request is in Kodexet/x, which isn't linked to this organization"
review_persona Assigned to the review persona The claim-time review-persona guard parked it
unclaimable No runner can take it The queue sweep found no runner that could ever claim it
blocking_agent_work Blocking agent work A person's open task that an open agent task depends_on (Person tasks)
decision_needed Decision needed A person's open decision task that is not answered yet, whether or not agent work waits on it
incident_flapping Incident keeps coming back An incident whose alert reopened it twice within 24 hours. The task is reopened here instead of in the queue, is no longer closed when its alert resolves, and its detail and reopen comment give the history. It is assigned to operator, so it gets no triage task
incident_waits_for_person Incident waits for a person An incident whose last finished implementation run offered options, parked when the alert reopens it or when its pull request merges while the alert still fires. The item carries that run's options (Options and Choose). A reopen that makes it flapping raises incident_flapping instead
decision_unplanned Decided, but nothing was planned from it A done decision task answered more than 24 hours ago that no task follows up or names, raised by the runner sweeper (Decided, but nothing planned)

An open event with the same dedupe key is never written twice. The payload is small and neutral — ids, reason, a one-line detail, verdict, model, PR URL, the first open question, adapter or version — never descriptions, digests or secrets, and at most 4 KB.

Only a person can act

A run that stops for something only a person can do names why in its handoff as needs_person (ADR-0024 §3, Taskbase task #1769, taskbase#633; agent-runner task #1768, agent-runner#268). agent-runner sends it in the finish call as digest.needs_person (POST /api/runs/{id}/finish).

needs_person For Shown as
credentials Logins, keys, accounts credentials
payment A paid plan, a licence payment
physical_access Hardware, a machine, a cluster console physical access
owner_decision Product direction, spending, external communication, access control owner's decision
destructive An irreversible step destructive step
legal A legal matter (added with the decision gate, task #2841) legal

Any other value answers 400. Taskbase puts the reason on the run's task.needs_attention and task.question events as payload.needs_person, and the item keeps it. Such an item:

  • is never triaged and goes to the people at once (Triage up the reporting line);
  • reads "… — only a person can act: physical access" on the page (ui/src/attention.js), with the wording in the table's last column;
  • adds "Only a person can act: …" to its Mattermost notice (api/internal/notice/message.go), with the reason's underscores as spaces, and is never held.

A triage run may name needs_person too; that ends the item's climb and writes the reason onto its open events in the same way. The personas' instructions for the key are task #1770 in Skatzi/skatzi-agents.

Person tasks: blocking agent work and decisions

Agent work can wait on a task only a person can do: an agent task depends_on it, and claims hold the agent task back until it is done. Such a task — assigned to a person (assignee_type 1) and not done — is raised on Needs attention so the wait is visible:

  • decision_needed while it is a decision task with no answer yet, whether or not agent work waits on it — but only once it is answerable: none of the tasks it depends_on is open.
  • Otherwise blocking_agent_work while at least one agent task (assignee_type 2) that is not done depends_on it. An answered decision that agent work still waits on reads as blocking_agent_work again: what is left is to close the task or hand it to an agent.

At most one of the two is open per task. When the reason changes, the old event resolves and the new one opens, so the change is notified. The event resolves when its condition no longer holds: the task is done, reassigned to an agent or unassigned, the decision is answered or removed, the depends_on link is deleted, no open agent task depends on it any more, or an open decision starts depending on an open task again.

Database triggers raise and resolve these events (migration 047, extended by migrations 048 and 069), not the API code paths. Every change that affects the condition re-evaluates it in its own statement: a depends_on link created or deleted (including by deleting a task) re-evaluates both ends, the task's assignee, done, project or decision edited, a dependent agent task done or reassigned, a decision task created, and a task an open decision depends_on done or reopened. The payload's waiting_task_ids names the waiting agent tasks (at most 20), and detail names up to five of them ("#450, #451 wait on it"); a decision_needed payload also holds the question as question, cut to one line of 300 characters.

The task also moves on the project board:

  • When agent work starts waiting on it, it moves to the project's Blocked column. This happens once, when the wait starts, so a card someone drags out of Blocked stays where they put it.
  • When no agent work waits on it any more and it is not done, it moves from Blocked back to Backlog. A task someone moved elsewhere is left alone.
  • Columns are matched by name in the task's project, as for runs; a project without such a column leaves the task where it is.

On the page these items offer their options and Discuss with an agent, like any task item. A blocking_agent_work item explains that the work waiting on it goes on once it is finished or handed to an agent; its option is It's done, let the waiting work start, which closes the task. To hand it to an agent instead, change its assignee from the task on its board.

Decision tasks

A decision task is a person's task that asks a question rather than for manual work: "Decide: which effectiveness indicator?". It carries a decision object:

Field Limits Meaning
question Required, at most 2,000 characters The question, self-contained and short enough to answer from a phone
summary At most 300 characters; empty when not given Why the decision matters to the owner and what changes with it, in plain words
choices At most 4; each {label, description, recommended}: a label (required, at most 40 characters, unique ignoring case), a description of at most 200 characters, and recommended: true on at most one The structured options, for the owner's picker. When a write sends them they replace options. Present only on a decision that has them
options At most 6, each at most 200 characters; empty and duplicate options are dropped Suggested answers as plain strings, offered as one-tap choices. With choices, the API sets them to the choices' labels, in the same order
answer At most 4,000 characters; empty until decided The decision once made

Options, choices, a summary or an answer without a question are refused with 400, and so are choices outside their limits; the message names the option at fault, for example "option 2 has no label". Ways to mark a task as a decision:

  • API: decision on POST /api/projects/{id}/tasks and PUT /api/tasks/{id}. Unlike most fields, PUT keeps the decision when decision is absent; null (or an empty question) clears it, and an object replaces it. GET returns "decision": null for an ordinary task. The API still accepts plain string options without choices.
  • MCP: create_task and update_task take decision (question, summary, choices, answer) and refuse plain string options (MCP server); update_task keeps it when omitted and removes it with clear_decision: true.
  • UI: in the task dialog of a task assigned to a person, tick Needs a decision, not manual work, then enter the question and the options, one per line. The board sends the decision only when the dialog changed it, so saving a stale card cannot undo an answer. An edit keeps the summary, and keeps the choices while the option lines (their labels) stay the same; changing the option lines saves them as plain options without choices (test a decision keeps its summary and choices through an edit in ui/src/TaskDecision.test.jsx).

Structured choices and plain options

Decisions got summary and choices in task #3341 (Taskbase PR #740, migration 095), so the owner can read a decision on a phone and pick a short label. Source: api/internal/task/model.go (NormalizeDecision), api/internal/attention/choices.go and options.go, read 2026-11-18.

A write with choices:

  • trims each label and description, and refuses the decision when a label is empty, longer than 40 characters, or used twice (ignoring case), when a description is longer than 200 characters, when there are more than 4 choices, or when more than one is recommended;
  • moves the recommended choice first, keeping the order of the others;
  • sets options to the labels, in that order, so readers of the plain options get the labels. options sent beside choices are ignored.

For example, this decision (from the UI test above):

{"question": "Keep the runner?",
 "summary": "It costs 40 € a month.",
 "choices": [
   {"label": "Keep it", "description": "Decide again in 4 weeks", "recommended": true},
   {"label": "Retire it", "description": "", "recommended": false}]}

is stored and returned with "options": ["Keep it", "Retire it"].

Plain options stay readable. A decision written with plain options only, including every decision from before migration 095, has no decision.choices on the task. The attention item's choices reads its options instead, one choice per option, in the same order (attention.ChoicesOf):

  • A leading recommended: (any case) is removed and becomes recommended: true, on the first such option only.
  • An option of at most 40 characters is the label, with no description.
  • A longer option is the description, in full, under a label made of its first clause — the text before the first ;, —, –, -, :, ., , or ( — when that fits in 40 characters, else of its first words, cut to 40 characters and ending in ….
  • When that label is one an earlier option already has, the option's first words are numbered by its position instead, for example Move the runner into a separate… (4).

From TestChoicesOf in api/internal/attention/choices_test.go:

Plain option Label Recommended
recommended: Keep the runner in Taskbase; decide Phase 3 at a second check in 4 weeks, … Keep the runner in Taskbase yes
Retire it Retire it no
Recommended: Move the runner into a separate service that the platform team owns and runs Move the runner into a separate… no: only the first recommended: counts
Move the runner into a separate service that the platform team owns, later Move the runner into a separate… (4) no

Answers. A choice's label chooses its option on Choose. The answer recorded is "label — description" for a structured choice with a description, its label alone without one, and the full original text for a plain option.

What agents read. The decision gate and a claim's open_decisions read a structured decision's options as "label — description" (the label alone when the description is empty), and plain options as they are. Source: Decision.OptionTexts in api/internal/task/model.go, gateCandidatesSQL in api/internal/task/gate_pg.go.

While the task is open, assigned to a person, unanswered and answerable (below), it is raised as decision_needed — also when nothing depends on it yet: the event opens when the decision task is created. To make agent work wait for it, link the agent task that carries out the decision depends_on the decision task.

Not answerable yet: Waiting for

A decision is answerable once none of the tasks it depends_on is open — typically the research whose agent fills in its options. Until then it raises nothing: no decision_needed event, no blocking_agent_work event for itself even when agent work waits on it, no Mattermost notice, and no move to Blocked. The event opens once, when the last prerequisite is done, unlinked or deleted, and is notified like any new event. Reopening a prerequisite (or linking the decision to another open task) withdraws the event again.

  • A decision with no options and no open dependency is still raised: a question-only decision invites a free-text answer, and one whose research finished without filling in options shows that research under Where the options come from.
  • Its dependents are unaffected: agent tasks that depends_on the decision wait for its answer as before.
  • Tasks carry the read-only decision_waiting_for: for an open decision, the ids of the open tasks it depends_on, in id order (omitted for any other task and once none is open). The board card and the task dialog show it as "Waiting for #12" (up to three ids, then "and n more").

On the page and in Mattermost

A decision item reads as a question, not as blocked work:

  • The headline is Decision needed, followed by "#450 waits on it" when agent work waits.
  • The question shows the task's full question.
  • Where the options come from appears while the decision has no options and has a depends_on predecessor in the organization (decision_source, below). It links to that task and shows its last run's summary. Since the item opens only once its prerequisites are done, it normally says no options were filled in, so the person can answer from the summary without digging through run logs; on an item withdrawn because the predecessor was reopened, it says that task's agent fills in the options when it finishes.
  • Choose an option offers the decision's options as buttons, the first marked recommended. The text field under them is the answer when no option is chosen ("Your answer" on a decision without options), and a note posted after the decision when one is (Answering).

The Mattermost notice says the task needs a decision and quotes the question, instead of "needs attention: blocking agent work":

@chris31 **#468 Decide the indicator** needs a decision: Which effectiveness indicator should replace approval rate? — #450 waits on it. [Open in Taskbase](https://taskbase.skatzi.com/attention/901)

A group of them reads "3 tasks need a decision".

Answering

The person answers by choosing an option, or writing an answer, and pressing Confirm (Options and Choose), or by confirming a chat plan's answer_decision (Discuss with an agent). Both run the same rule (task.Service.Decide). Taskbase records the answer and then:

  • A persona is given (only a chat plan can set persona, and optionally model): the task is handed to that persona, on that model when one is set.
  • Agent work waits on it (an open agent task depends_on it): the task is closed, so those agent tasks become claimable and start.
  • Nothing waits on it: the task is handed to the project-manager persona (assignee_type 2) without setting a model, so its next run uses the persona's default size. The task is queued, and the project manager turns the decision into work.

A comment then records the decision on the task (**Decision:** <answer> above the quoted question, then the note when one was given) for the people and agents that read its comments. If the comment is refused, the result says the decision was already recorded. Source: api/internal/task/service.go (Decide), api/internal/attentionaction/choose.go and service.go (DecideWithComment), api/internal/session/execute.go; Taskbase PRs #430 and #447, read 2026-10-18.

The executing agent receives the answer as structured claim data, not through the task description, which the claim leaves unchanged (Runners and Runs):

  • A run of the decision task itself gets it in task.decision.
  • A run of a task that depends_on or is a follow_up_of the decision task gets it in decision_candidates.

Planning decisions

Plan every "Decide: …" step as a person's decision task (assignee_type 1, decision.question), never as an agent task:

  1. When an analysis is to work out the options, the decision task depends_on that analysis task, with no options yet. Its description names the analysis task and says that the analysing agent fills in the options.
  2. The agent task that carries out the decision depends_on the decision task, so claims hold it back until the decision is made.
  3. The analysing agent's claim lists the decision in open_decisions. Before it finishes, it fills in decision.summary and decision.choices with update_task (2–4 choices, each a label of 1–5 words and a one-line description, the recommended one first and marked) and adds the key findings to the decision task's description, so the person can decide from Needs attention.

The MCP create_task and update_task descriptions give agents the same guidance.

Decided, but nothing planned

A safety net for a decision whose answer was recorded but never turned into work. The runner sweeper calls attention.SyncUnplannedDecisions every 15 s (Runners and Runs), which raises decision_unplanned, shown as Decided, but nothing was planned from it, for a task when all of these hold:

  • It is done and its decision is answered.
  • The answer was recorded between 24 hours and 30 days ago (tasks.decision_answered_at, Database Schema). Older answers are never flagged.
  • No task depends_on it and no task is a follow_up_of it.
  • No task or epic in its organization, created in the 24 hours after the answer, names #<id> in its title or description. A project request is a task, so it counts too.
  • The answer does not say that no work follows (attention.NoWorkFollows, below).

The event is raised once per answer, on the task, with the question and the detail "Answered “”, but no task depends on it, follows it up or names it." It is not raised again for the same answer, also after a choice resolved it; a new answer starts over.

Answers that need no work. attention.NoWorkFollows is a short allow-list, matched case-insensitively at the start of the answer: "Not now", "Not yet", "Pause…", "Postpone…", "Defer…", "Do nothing", "Nothing…", "No action", "No work", "No follow-up", "No change(s)", "Keep (it) as is", "Leave (it) as is", "Won't do", "Not needed", or a bare "No". The list is short on purpose: an answer it misses is flagged and Nothing needs to happen clears it, while an answer it matched by mistake would never be flagged.

Resolution. On the next sweep the event resolves when a task now depends_on it or is a follow_up_of it, the task is reopened, or the answer is cleared. Choosing an option resolves it too.

Options (What choosing does):

  • Hand it to the project manager to plan (recommended) posts the choice, reopens the task and assigns it to the project-manager persona, clearing the task's model so the run uses that persona's default (task.Service.Replan). The answer is kept.
  • Nothing needs to happen only posts the choice. The task stays done, and the recorded choice keeps the item from coming back for that answer.

Source: api/internal/attention/unplanned.go, api/internal/attentionaction/choose.go (planOrNot), api/internal/task/service.go (Replan); Taskbase PR #453, read 2026-10-18.

Resolution and retention

  • Task events resolve when an option is chosen for their item, and when the task is requeued, claimed or marked done, or otherwise leaves needs_attention (including being unassigned from agent work). A database trigger on tasks (resolve_task_notifications()) does this, so every code path that changes a task resolves its events in its own transaction. It skips blocking_agent_work and decision_needed events: a person's task is never dispatched, so those resolve by their own condition through the triggers of migrations 047, 048 and 069 (Person tasks).
  • decision_unplanned resolves on the sweep that finds its task followed up, reopened or no longer answered (Decided, but nothing planned), or when an option is chosen.
  • runner.offline resolves when the runner is seen again; runner.adapter_held when the adapter is no longer held for auth_failure; runner.update_failed when the runner reports its target version, its target changes, or it reports update_mode: "image".
  • Resolved events stay listed (flagged resolved) for 24 hours and are deleted 30 days after they resolve (attention.RunPurge, hourly). Open events are kept until they resolve.

Triage up the reporting line

Every minute (triage.Interval, and at API startup) Taskbase gives each agent task with an open task.needs_attention or task.question item a triage task for an agent: the operator, or a manager role from the organization's team. The agent resolves the item, or leaves it open and Taskbase hands it one level up; at the top the item stays with the people. The item stays on Needs attention throughout, and a person can handle it there at any time; while a level holds it, the page says so (With a triage level).

Built for the operator in Taskbase task #1457, and routed by reason class and up the reporting line in task #1767 (ADR-0024 §3 and §4, taskbase#646, release v1.246.0; on 2026-10-27 production still ran v1.244.0, without the reporting line). Read on 2026-10-27 from Skatzi/taskbase main 38d2efa (api/internal/triage/, api/internal/attention/class.go, api/internal/task/triage.go, api/internal/task/triage_pg.go). The operator's rules for these tasks are its persona's (task #1461); the manager roles' are task #1770.

Who triages first: reason classes

Class Reasons First goes to
Run health run_failed, run_cancelled, run_lost, usage_limit_exhausted, runner_restarts_exhausted, unclaimable, review_persona, and any reason not listed in this table operator
Work task.question (the event kind), review_blocked, review_rounds_exhausted, review_out_of_date, no_pull_request, investigation_only, pull_request_unreviewed The first usable role above the task's role. When the task's role has no manager, as in a team nobody edited, operator
People only decision_needed, blocking_agent_work, pull_request_unlinked, incident_flapping, incident_waits_for_person, decision_unplanned Nobody: the people, at once
  • Mixed reasons. An item takes the class that keeps the most with people: any people-only reason makes it people only, else any work reason makes it work.
  • needs_person. An item one of whose events names a needs_person reason is never triaged.
  • Nobody triages their own task. A task assigned to operator gets no operator triage, and the walk up the line skips the task's own persona.
  • No usable manager. A work item whose role has a manager, but no usable role above it, stays with the people; it does not fall back to operator.
  • Runner events (runner.*) are not task items and are never triaged.
flowchart TD
    Item[Open item on an agent task] --> Class{Reason class}
    Class -->|people only or needs_person| People[The people]
    Class -->|run health| Op[Triage task for operator]
    Class -->|work and the role has no manager| Op
    Class -->|work and the role has a manager| Mgr[Triage task for a manager role]
    Op -->|done and the item is still open| People
    Mgr -->|done and the item is still open| Up{Usable role above}
    Up -->|yes| Mgr
    Up -->|no| People

The diagram shows the first level and the climb. The operator's level never climbs: it is outside the reporting line of the work, so an item the operator leaves open goes to the people even when an edited team gives operator a manager.

The triage task

Field Value
Title Triage Needs attention on #<id>: <title>
Project and group The task's project, group Backlog (no group when the project has none)
Assignee Agent operator, or the manager role's persona
Model large (task.OpsModel), for every level
required_labels ["role=ops"] (task.OpsLabel) for operator; none for a manager role
Link relates_to the task
Gitea issue None: it is not created through the issue sync, and the issue reconciler skips triage tasks
Description The job for its level (below), then the item (kind, reason, detail, question, raised at), the previous level (its triage task, role title and last run's summary) when there is one, the task's pull request with its state, CI state and failing checks, the last run's outcome and summary, the last handoff's open questions, and the task's description

The job differs by level. The operator's says to resolve the item and update the task, or, when only a person can do it, assign the task to the owner and comment exactly what the person must do. A manager role's says it triages "as <title>, a manager of its role", lists what it may do (below), and says to close the triage task and leave the item open when it cannot resolve it, or to name needs_person when only a person can act. Both say never to put a secret in a comment.

The table attention_triage ties each triage task to its task, with its level in the climb.

One level up

When a triage task is done and its item is still open, with no event raised after the triage task was done, the next sweep gives the item to the first usable role above the role that just triaged it. The new triage task's description carries the previous level's summary. An event raised after a triage task was done starts a new climb instead.

The climb ends, and the item stays with the people, when:

end_reason When
top No usable role is left above, or the level just done was the operator's
people_only A people-only reason joined the item
needs_person The triage run's handoff named a needs_person reason; Taskbase writes it onto the item's open events, so the page and the notice show it
item_limit The item had 3 triage tasks (task.MaxTriagesPerItem), one per level of the deepest allowed chain
task_limit The task had 6 triage tasks in all (task.MaxTriagesPerTask)
bounce The task's assignee went back to a persona it had at an earlier level of the same item
paused The organization's agent work is paused

Each end is logged as triage: item left with the people with task_id, triage_task_id, level and reason.

Fallback

A role is usable for a triage task when the organization is not paused, the role is active, its persona is still in the agents repository, and a runner that is set to running, serves the organization and was seen within 24 hours (runner.RecentlySeenWindow) could claim the triage task; for operator that runner needs role=ops. An unusable role is skipped and the item goes one level further up. With no level left, the item stays with the people.

Which items get one: the loop guard

A task gets a triage task only when all of these hold:

  • It is open and assigned to an agent. A person's task never gets one; this covers the person-task reasons blocking_agent_work and decision_needed.
  • It is not a triage task itself.
  • It has no open triage task. An item raised while one is open is that triage task's to handle.
  • For a new climb: its newest open item was raised after its last triage task was done, and it was triaged fewer than 6 times (task.MaxTriagesPerTask), counting every triage task it had. For the next level: the climb has not ended.
  • Its organization has fewer than 5 open triage tasks (task.MaxOpenTriage). Further items wait for a later sweep, oldest item first.

Taskbase checks these again under a per-organization lock just before it creates the task, so two sweeps never create more than the limits allow.

When nothing is created

A task whose team cannot be read (triage: read team) or whose item context cannot be built (triage: build item context) is logged and tried again on the next sweep; one whose item resolved meanwhile is skipped. Each created task logs triage: attention item handed to <persona> with task_id, triage_task_id, reason, class and after (the previous level's triage task, or 0).

What a triage run may do

A run of a triage task, the operator's or a manager role's, may requeue and comment on the one task it triages, and on no other task, its own triage task included (Taskbase task #1669, decision #1665, extended to manager roles by #1767). It uses POST /api/tasks/{id}/requeue and POST /api/tasks/{id}/comments, through the MCP tools requeue_task and create_task_comment. An answer to a question is a comment followed by a requeue. Every other route closed to agents stays closed to it; how the API decides is in Run-scoped access. Read on 2026-10-27 from Skatzi/taskbase main 38d2efa (api/internal/authz/guard.go, api/internal/authz/store_pg.go, api/internal/task/handler.go, api/internal/comment/handler.go).

  • Requeue keeps a person's state checks: a needs_attention task, or a dispatched one without an active run, goes back to queued, and so does a stranded task with no dispatch state; any other state answers 409, and so does a task in Review whose review rounds are exhausted (Requeue and exhausted rounds).
  • Comment is signed — <title> via Taskbase triage on the task's Gitea issue, in place of — <person> via Taskbase. <title> is the run's role title from the team, else the persona's name, so a default team signs operator's comments with the operator persona's name. On a task without an issue it is stored in Taskbase with that author.
  • Reassign and split use the routes every run has: update_task to give the task to another persona, and create_task with follow_up_of the task. Both follow the delegation rule of the triage run's role.
  • Log: each requeue and comment logs the triage task and the run: task requeued by triage run (id, triage_task_id, run_id, persona) and comment posted by triage run (task_id, comment_id, triage_task_id, run_id, persona).
  • Refusal: on any other task the API answers 403 with forbidden: a triage run may only requeue and comment on task N, the task it triages.
  • Still people only: POST /api/tasks/{id}/requeue-after, POST /api/attention/requeue and POST /api/attention/{id}/choose.

With Org Chart v2

With the organization's Org Chart v2 switch on, the climb is the same, with these additions (ADR-0026 §3–§4, tasks #2839 and #2841):

  • Escalate explicitly. A run may hand its own task to its manager role with a comment (Escalating to the manager) instead of only leaving an item open for triage.
  • The manager's decides. A manager triaging a work item is told its role's decides text and, when the organization has a decision gate, to name needs_person: owner_decision for a decision beyond it. That item then goes to the gate at once, not to the owner.
  • Roles of their own. The climb follows reports_to between roles, so it also passes roles of their own; a role built on operator counts as operator.

The decision gate

With the organization's Org Chart v2 switch on and a decision gate role named (decision_role), an item that asks for a decision goes to that role before the owner hears of it. The gate answers it within the policy in its mandate (decided), or hands it to the owner with a brief (forward). Design: ADR-0026 §3; built in Taskbase task #2841 (taskbase#718, v1.262.0, migration 093). Read on 2026-11-12 from Skatzi/taskbase's CLAUDE.md at main 97ca65d (api/internal/decisiongate/, api/internal/triage/gate.go). With the switch off or no gate role, nothing on this page is gated, held or described differently.

What goes to the gate

Item To the gate?
A person's open, answerable decision (decision_needed) not marked owner-only Yes
An agent task's item whose every needs_person is owner_decision, with no people-only reason Yes
A hard limit: needs_person credentials, payment, physical_access, destructive or legal Never: straight to the owner
A decision marked owner-only (decision.owner_only, kept when it is answered) Never
Any other people-only reason Never

The gate is skipped, and the item stays with the owner as before, while the gate role is paused or inactive, no recently seen runner serves the organization, the organization is paused, or the task is the gate role's own.

The gate task

Right after each triage sweep, so within a minute, Taskbase gives each such item a gate task "Decide on #n: …" in the task's Backlog, assigned to the gate role (its base persona's default model), linked relates_to, without a Gitea issue. Its description holds the two verdicts, the gate role's mandate as its policy, the question, the options (a structured choice as "label — description", Structured choices) and the item's context. There is one gate record per item, and at most 5 open gate tasks per organization (task.MaxOpenGates); further items wait.

The gate task's run may comment on and requeue the task it decides for, like a triage run, and it gives its verdict with POST /api/tasks/{id}/gate-verdict (MCP gate_verdict, the gate task's own run only):

Verdict Fields Then
decided answer, reason, policy_line A decision is answered as a person would answer it; a run's question gets the answer as a comment and the task is requeued
forward recommendation, uncovered (why the policy does not cover it) The item stays with the owner, with the brief

Either way the verdict is recorded, commented on the task (who, what, why and the policy line, or the brief) and the gate task is closed. When the owner acted first, the verdict answers 409, nothing is posted, and the gate task is closed.

Item already handled

Each gate sweep first closes the open gate tasks whose item no longer needs the gate. That is the case when the owner answered or requeued the item before the gate ran. A gate task is closed when, in an organization with Org Chart v2 on:

  • its decision_gate record has no verdict, and
  • the task it decides for is done, or has no open task.needs_attention or task.question event.

It is closed even while a run is still working on it; that run's gate_verdict then answers 409. The record keeps no verdict. The closed gate task no longer counts towards the 5 open gate tasks (task.MaxOpenGates), so a waiting item gets its gate task in the same sweep. The API logs decision gate: item already handled with task_id and gate_task_id.

Built in Taskbase task #2864 (taskbase#724, merged; no migration): task.PostgresStore.StaleGates (api/internal/task/gate_pg.go) and triage.GateSweeper.Sweep (api/internal/triage/gate.go). Written on 2026-11-12 from tasks #2864 and #2877, not from the code, which this page's writer could not read; see Shipped in for the release.

On the page

While the gate works on an item, the row reads "with <gate title> (decision gate #n)" (held_by with kind gate), and its Mattermost notice is held as for a triage level, up to 4 hours. The owner may still answer at any time.

A forwarded item shows the gate's brief: its recommendation and why its policy did not cover it; once the owner answers, the answer beside the recommendation; and Add to the gate's policy, an editable line prefilled from the question and the answer. Adding it appends the line to the gate role's mandate, once per forwarded record, so the next such item is decided by the gate. This is the learning loop of ADR-0026: over time fewer items are forwarded.

The decision record

Table decision_gate keeps every gate record: gate task, task, role, question, options, verdict (NULL while pending), answer, reason, policy_line, recommendation, uncovered, the run, decided_at, and whether and by whom a policy line was added. GET /api/organizations/{orgId}/gate-decisions?task_id=&limit= (MCP list_gate_decisions) lists it with owner_answer, the owner's answer to a forward. The attention list carries gate on an item: the task's newest verdict (id, title, verdict, recommendation, uncovered, policy_added).

Write a gate policy

The gate role's mandate is the owner's decision policy. Keep it to one line per kind of decision, each with the answer and its limit, for example:

Dependency majors with a migration guide and green CI: approve.
Spending: decide up to 20 EUR a month; forward anything above.
Naming, copy and wording in the shop: follow the brand guide; forward a new tone.
Anything about customer data or access: forward.

Hard limits never reach the gate, whatever the policy says. Use Add to the gate's policy on a forwarded item to grow it from the owner's own answers.

Mattermost notices

Settings

Per organization, a global administrator sets them under Organization → Settings → Mattermost notices (the card is hidden from others; the API answers 403):

  • Incoming webhook URL — a Mattermost incoming webhook for the organization's channel. It is stored encrypted (AES-256-GCM with TASKBASE_SECRET_KEY, bound to the organization) and is write-only: the API only says whether one is set, and never logs it. Saving needs the key; without it the API answers 503. Paste a new URL to replace it, or Remove webhook.
  • Mention — Mattermost usernames to @-mention in every notice (lowercased, a leading @ stripped, at most 20). The Mattermost app turns the mention into a phone notification; sound and do-not-disturb are set in Mattermost.
  • Send test notice — posts a test line (with the mentions and a link to /attention) at once, and shows Mattermost's error if it fails.
  • Warn when a runner goes offline — on by default; saves as soon as it is ticked or cleared. See Muting runner-offline warnings.

An organization without a webhook gets no notices. Setting a webhook does not replay the backlog: only events raised after it was set are posted.

Which organizations a notice goes to

A task event goes to its task's organization. A runner event goes to every organization that can see the runner — all organizations with a webhook for an instance runner, the organizations it serves for an organization runner — the same rule the attention list uses.

Muting runner-offline warnings

A global administrator can turn off Warn when a runner goes offline (organization_mattermost.warn_runner_offline) for an organization. While it is off:

  • No runner.offline notice is queued for the organization, and its pending runner.offline deliveries are set to dropped when the switch is turned off.
  • The Needs attention page hides a runner.offline event once every organization that sees the runner (within the caller's filter) has muted it. A runner shared with an organization that still warns stays listed; an administrator's unfiltered view hides it only when all organizations that see the runner have muted it.
  • The runner's state on the Runners page, and other attention kinds (runner.adapter_held, runner.update_failed, task events), are unchanged — the event is still raised and resolved.

Message

One line and a link, with the mentions first. Titles, reasons and ids only:

@chris31 **#331 Order the migrations** needs attention: review blocked — waiting for migration order. [Open in Taskbase](https://taskbase.skatzi.com/attention/812)

A notice about one task event also links its pull request, [Pull request](…) before the Taskbase link, when one is found the same way as on the page (Which pull request an item shows). Grouped notices carry no pull request link.

The reason is worded in lower case after "needs attention:"; decision_unplanned reads "decided, but nothing was planned from it" (api/internal/notice/message.go). Its payload holds the decision's own question, appended as "Question: …" — not "The agent asks: …", which is for the stopping run's open question merged in by One notice per task — so the line reads like this (the line TestNoticeMessages in api/internal/notice/notifier_test.go expects, with a production link in place of the test's):

@chris31 **#468 Decide the indicator** needs attention: decided, but nothing was planned from it — Answered “Cost per approved task”, but no task depends on it, follows it up or names it. Question: Which effectiveness indicator should replace approval rate? [Open in Taskbase](https://taskbase.skatzi.com/attention/915)

Free text (titles, details, questions) is cut to one line and a length limit, and an @ in it is neutralised, so a task titled @channel cannot page the channel. Links need PUBLIC_BASE_URL; without it notices carry no link.

Grouping, limit and delivery

The notifier runs in every API replica every 15 seconds. It locks each organization's settings row with FOR UPDATE SKIP LOCKED, so one replica at a time posts for an organization and the limit holds across replicas.

  • One notice per task: first, the events one task raised within two minutes of each other become one notice — a finished run can raise task.needs_attention and task.question at once. The task.needs_attention event is the headline and the link; the question is appended: "#490 Title needs attention: finished without a pull request. The agent asks: …". The merged notice keeps the place of its earliest event, and every merged event's delivery is marked sent together.
  • Grouping: events with the same cause — kind and reason, adapter or version — raised within two minutes of the group's first event become one notice naming them (up to 10, then "and N more") and linking to /attention. A group is posted once its first event is two minutes old, so a notice arrives roughly two minutes after the event.
  • Limit: at most 10 notices per organization per hour. When more are ready than fit, the last notice that fits summarises the rest; when none fit, they wait for the next free slot.
  • Retries: a failed post is retried with backoff (30 s, doubling, at most 1 hour) until the event is 24 hours old; then its delivery expires. A failed post also holds back the notices after it in the same round. Each failure is recorded without the webhook URL.
  • Held while a manager role triages (ADR-0024 §3, task #1767, heldSQL in api/internal/notice/store_pg.go): the notice of a task item stays pending while the item's newest triage task belongs to a manager role, not operator, and its climb has not ended. It is sent when the climb ends or when the event is 4 hours old (notice.HoldFor), whichever comes first. Items triaged by operator, people-only items and items with needs_person are never held, so a team nobody edited is notified as before. The hold starts only once the triage task exists: the sweep runs every minute and a notice waits about two minutes, so the manager's triage task is usually there first, but the first notice can go out before it (taskbase#646, known limits). The page shows the level on the item under the same rule, for every persona and at any age (With a triage level).
  • Resolved before sending: the delivery is dropped. Resolution itself is never posted — the page shows it.
  • If the API stops between posting and recording, the notice is posted again: at worst a duplicate, never a loss.

The "Needs attention" page

/attention lists the open events of the organizations the person can read, newest first, and those resolved in the last 24 hours, greyed and marked resolved. The list has one row per task: a task's open events — or, when none is open, those resolved in the last 24 hours — are merged into one item, headed by its newest task.needs_attention event (else its newest event). When the headline has no question, the newest task.question event's question is shown under the reason as "The agent asks: …"; when it has no pull request, the newest merged event that has one supplies it — so a merged item whose headline names no pull request still links one. Each task row links its pull request, if one is found. Runner events stay one row each. The user menu (top right) has a Needs attention item that opens this page and shows the number of open items — tasks and runner events (refreshed every minute and after each action). The page is laid out for a phone first, works on a desktop, and follows light and dark mode. Below 768 px the list is replaced by a deck of cards, one item at a time (On a phone: one card at a time).

/attention/{event} shows one item, found by any event merged into it, so a Mattermost link or request chip to a task's question event still opens the task's item. It shows the task (linked to its board) or the runner (linked to it on the Runners page), the reason and its detail, the agent's question and the last finished run (role, model, outcome, the first lines of its summary). A Pull request section right under the task title links the item's pull request as Owner/repo#N ↗ and, when it did not come from the task's own runs, says where it was found ("from the task this one depends on or follows up", or "named in the task or its last run report, not recorded by a run"). An item about an agent review — a review reason, or a last run that was a review — without a pull request says plainly that none was found. An item resolved more than 24 hours ago, or not visible to the person, shows "This item is not listed any more".

Two ways to handle an item

An open task item offers exactly two ways to handle it, on the item page under Act (Taskbase PR #432, AttentionActions in ui/src/App.jsx, read 2026-10-17):

  1. Choose an option and confirm. Pick one of the item's options (the first is marked recommended), optionally add a note, and press Confirm. Taskbase carries the option out and hands the task on; the person never picks a persona or a size. Options and Choose says where the options come from and what each does.
  2. Discuss with an agent. Open a chat about the item with an agent, which proposes a plan; Taskbase carries it out only when the person confirms it (Discuss with an agent).

The list /attention offers both in each open task row: the options as buttons, with the note field and Confirm once one is picked, and Discuss with an agent. A row without options shows only the latter. Resolved items and runner items have neither; a runner item links to the runner.

A parked agent task's item also has Requeue after… (Requeue after a time). The page has no other controls. Closing, reassigning, resizing (changing the model) and requeueing a task are done from the task on its project board; the task's dialog (TaskModal in ui/src/App.jsx) holds its assignee, its model and Requeue. A run is cancelled from the Runners page or the organization's Runs tab.

On a phone: one card at a time

Below 768 px ((max-width: 767.98px), useNarrow), /attention shows a deck of cards instead of the list, so a person can read and answer an item from a phone, usually with one tap. The page switches when the window crosses that width. The desktop list and the item page /attention/{event} are unchanged. Added in Taskbase task #3342 (taskbase#741); read on 2026-11-18 from Skatzi/taskbase main 8772818 (ui/src/AttentionCards.jsx, ui/src/attention.js, AttentionView in ui/src/App.jsx).

The deck holds the open items only: resolved items and dismissed ones are left out, and same-cause groups are not collapsed. Above the card, ‹ and › step through the deck and a counter reads "3 of 7". With no item left, the page says "Nothing needs you right now."

A card, top to bottom:

Part Shows
Header A kind chip, the project (else the organization) and the item's age
Title The task's title and #id, or the runner's name
Question In large text: a decision's question, else the agent's question, else the item's reason line
Summary Under the question: a decision's summary, else the reason line under an agent's question, else the reason's detail
Options The item's choices as full-width buttons, the recommended one first, highlighted and marked Recommended, each with its one-line description
Other… Task items only: a written answer (decisions only, sent with Send answer) and an optional note, sent with the answer or with the option tapped next. A link opens the full item
Details Collapsed by default: the task's description and the item's full context, as on the item page

The kind chip (cardKind) is Decision for a decision_needed item. For a run's needs_person it is Needs credentials, Needs payment, Needs physical access, Decision (owner_decision), Destructive step or Legal question. Otherwise it is Your step for blocking_agent_work, Question for a task.question item, Runner for a runner item, else the reason's name, such as Review blocked.

The buttons (cardChoices) come from the item's choices (label, description, recommended) when there is one per option. Otherwise each option is a button without a description, and the first is the recommended one, as the API lists options recommended first. Which options an item has is in Options and Choose; the decision's fields are in Decision tasks.

A runner item has no buttons and no Other…. Requeue after… and Discuss with an agent are not on the card: the link under Other… opens the full item, which has them.

A tap, then Undo

Tapping an option, Done or Send answer does not send it at once. The card leaves the deck, the next card shows, and a bar reads Chose "<option>" for #n. with Undo for 5 seconds (UNDO_MS). Undo brings the card back and sends nothing. After 5 seconds the page posts POST /api/attention/{id}/choose with the option and the note, and shows the result line as on the desktop (Options and Choose). A waiting choice is sent at once when the person taps another one or leaves the page.

When the choose route refuses, the card comes back with the reason (and the step that failed). A 409 that says the item is resolved marks the card stale instead (below).

A person's steps: checklist and Done

When the item asks a person to do something, the card shows the steps as a checklist:

  • for blocking_agent_work, from the task's description;
  • for an item whose run set needs_person, from the last run's summary, else the task's description.

Each Markdown list item is a step with a tick box. Its inline code that contains a space, and a fenced code block under it, is a command with a Copy button (checklistSteps). Text without a list or a fenced block gives no checklist. The ticks are for the person only and are not saved.

With a checklist, Done sends the item's done option (doneOption): the first option that starts with "done", "finished", "stored", "added" or "completed", optionally after "It's", "I've" or "I have" — for example It's done, let the waiting work start. The card has no field for a secret, and the note field's hint says never to paste a password or key.

Stale items: Dismiss

An item whose task is done, whose decision is answered, or whose choice came back 409 as resolved shows Already done, dismiss? with Dismiss in place of its buttons (staleItem). The API has no dismiss: Dismiss hides the item on this device only, in the browser's localStorage under attention.dismissed (the last 200 item ids). The item stays on the desktop list and on other devices until Taskbase resolves it. In a private window the dismissal may last for the visit only.

With a triage level

An open task item that an agent triage level holds shows "with <title> (triage #n)": in the list under the row, and on the item page under the task title. <title> is the role's title and "triage #n" links the triage task's dialog on its board. Resolved items never show it. The person can still handle the item as usual.

The API sends this as held_by. An item is held when all of these are true:

  • The item is open, and its headline is a task.needs_attention or task.question event.
  • The task's newest attention_triage row has not ended its climb (ended_at is NULL).
  • That row's triage task is still open, or no task.needs_attention or task.question event was raised after it was done.
  • None of the task's open events has a people-only reason.
  • The headline event names no needs_person.

These are the conditions of the Mattermost notice hold (heldSQL), with two differences: the line shows for every persona, operator included, and with no age limit (the notice hold ends after 4 hours).

Added in Taskbase task #1815 (taskbase#658, merged 2026-10-28). Read on 2026-10-28 from Skatzi/taskbase main 3ba8743 (api/internal/attention/store_pg.go, api/internal/attention/group.go, ui/src/attention.js heldBy, ui/src/App.jsx HeldBy).

Context header

Each task item carries what a person needs to understand it at a glance: the list row shows it compactly, and the item page shows it in full.

  • The task: its title, project and repository, its goal (the epic) when set, and its assignee.
  • What the agent did: the last run's outcome, runner and failure reason, and its pull requests: the item's own, then the last run's when that is a different one. Each shows Owner/repo#N, its state (open, closed or merged) and a CI badge with the combined status at the head commit. The states come from the pull-request read route, through its cache. The list never waits on Gitea: it shows the cached states, including states up to 1 hour old (pullrequest.StaleTTL), and reads a state that is missing or older than 60 seconds again in the background, one read per pull request at a time. A pull request whose state is not read yet comes back with only its url and "pending": true; the page shows "reading state…" and loads the list once more after 3 seconds, and one still pending then is picked up by the next 60-second poll. A Gitea answer without the pull request (a 200 with an empty body) is not cached. The chat frame of a session about a task (ADR-0015) still reads Gitea directly, through the read route; it is not cache-only.

Linked references

#n, Owner/repo#n, PR #n (in the task's repository), pull-request URLs and Gitea Actions run URLs in the item's detail, question and last run summary render as links with their title and state; tap one to expand it (title, state or done, and the link). At most 20 are resolved per item. A reference resolves only when it is a task of the item's organization, or a pull request or CI run in a repository under the organization's gitea_org on the configured Gitea host; a CI run takes its check name and state from the item's pull requests. A pull request named in the text stays plain text until its state is cached. Anything else stays plain text.

Same-cause groups

Open task items that share one cause with at least one other open item in the same organization carry a group, and the list collapses them into one row: the group's label and count, expandable to its items, each with its own options. The first rule that applies wins:

Rule Items share
usage A usage hold on the same adapter
runner_restart A runner restart on the same runner
waits_on The same task they wait for (below)
unclaimable The same "cannot be claimed" detail
runner_error The same runner and first summary line, or a run lost on the same runner

The page has no Requeue all button. POST /api/attention/requeue requeues a group's tasks in one call, and an agent's plan can do the same with requeue_group (Discuss with an agent). It answers per task: requeued, skipped (its item was resolved meanwhile) or refused with the reason.

Waiting on #n

When the item's text names an open task it waits for ("#n isn't done", "waiting on #n", "blocked by

n", "depends on #n" or "until #n"), the item has waits_on, and an agent's task gets the option

Try again when #n is done (Options and Choose).

Choosing it posts the choice as a comment, adds the depends_on link (refused when it would make a cycle, when the target is in another organization, or when the link exists), then requeues. POST /api/tasks/{id}/requeue-after does the same as one route: link, the comment if one is given, then requeue. The claim then holds the task until

n is done. The steps run in order and stop at the first refusal; the result names what happened

("dependency added, comment posted; requeue refused: …").

Requeue after a time

A parked agent task's item has a Requeue after… action with a date and time picker. It requeues the task with a start_after, so no runner claims it before that time. When an agent's option names a time (for example "Requeue #2262 with requeue-after 2026-11-07 03:00 UTC"), the picker is prefilled with it (task #2405, taskbase#689). The task dialog has the same action.

Despite its name, POST /api/tasks/{id}/requeue-after is the Waiting on #n route and takes no time; a time goes in the body of POST /api/tasks/{id}/requeue (Control-room endpoints).

Open question: which wordings of a time in an option the prefill recognises; this writer could not read the UI code (ui/src/startAfter.js).

Options and Choose

Every task item has options: what the person may choose, recommended first. Choosing one is a single call, POST /api/attention/{id}/choose, that carries the option out and resolves the item. The page sends it on Confirm with the option and the note, then shows one result line, for example "Chose “Park it”. Parked in Backlog, unassigned." (choiceResult in ui/src/attention.js), or the refusal with the step that failed. Source: Taskbase PRs #430 and #432, read 2026-10-17.

Where the options come from. The first rule that applies wins:

  1. A decision_needed item: the decision's own options (Decision tasks), possibly none; for a decision with structured choices, their labels.
  2. An agent's task whose headline event kept options: the options the stopping run gave in its finish digest (digest.options, Runners and Runs). Its task.needs_attention and task.question events keep the first 4 distinct ones, each cut to one line of at most 100 characters, at most 1,000 bytes together. A person's task (blocking_agent_work) ignores them. The personas tell every agent that stops with its task in Needs attention to end with 2–4 concrete options, recommended first, each a one-line action Taskbase can carry out (Skatzi/skatzi-agents, task #1073).
  3. The standard set for the reason:
Reason Options
run_failed, run_cancelled, run_lost, runner_restarts_exhausted Try again, Try again on a bigger model, Park it
review_blocked, review_out_of_date Give it one more review round, Park it
review_rounds_exhausted Park it — nothing grants another round until a person raises the project's review_max_rounds; a task parked in Review with the rounds message is then requeued by the queue sweep
blocking_agent_work It's done, let the waiting work start
decision_unplanned Hand it to the project manager to plan, Nothing needs to happen
review_persona Park it — requeued, the review persona would only be parked again
Any other reason (among them no_pull_request and investigation_only), and a task.question item Try again, Park it

An agent's task with waits_on #n gets Try again when #n is done in front of the standard set. Agent and standard options are at most 4; a decision has up to its 6.

Beside options, every task item has choices, one per option in the same order, for a picker: a decision's structured choices, else each option read as a choice as Structured choices and plain options describes, standard and agent options included.

What choosing does. The option must be one of the item's options, or the label of one of its choices (both case-insensitive, the option text tried first), except on a decision, where anything else is the answer and may be any text. A label stands for its option: an agent's task posts and acts on the option, and a decision records the answer that Answers gives — "label — description" for a structured choice, the full original option for a plain one. note is optional.

Item Choose
An agent's task Posts the comment **Chosen:** <option>, then the note, and then: Try again when #n is done adds the depends_on link to #n and requeues; Try again on a bigger model requeues one tier up (below); Park it unassigns the task and moves it to the project's Backlog column; any other option — Try again, Give it one more review round, an agent's own option — requeues it on its own persona and model, so the next run reads the comment
decision_needed Records the option as the answer, as Answering does: closes the task when agent tasks wait on it, else assigns it to project-manager without setting a model, which queues it. Then posts the decision comment, followed by the note
blocking_agent_work It's done, let the waiting work start posts the choice and closes the task, so the waiting agent work can start
decision_unplanned Posts the choice. Hand it to the project manager to plan then reopens the task and assigns it to project-manager with no model (Decided, but nothing planned); Nothing needs to happen does nothing more

Try again on a bigger model steps up from the tier the next run would ask for: the task's model, else its persona's default model, plus model_escalation steps, capped at large. A task with a model id rather than a tier, or no model at all, goes to large.

The steps run in order and stop at the first refusal, as for Waiting on #n. When every step is done, the item's events are resolved and their payload records chosen (the option, cut to 100 characters) and chosen_by (the person's username).

The UI ships a web app manifest (start_url /attention) and icons, including the 180 px Apple touch icon, so the page can sit on a phone's home screen. There is no service worker and no web push. Links from Mattermost open in the browser, not in a home-screen app (an iOS limitation), so the browser is where a person needs to stay signed in.

Discuss with an agent

Discuss with an agent (called Resolve with an agent before Taskbase PR #432) is offered on every open task item, of any reason, including person tasks: on the item page /attention/{event} under the options, and in the item's row on the list /attention, grouped items included. Runner items and resolved items do not have it in either place. It opens a chat with the attention-helper persona about the item on the agent chat page /chat/{id}, in which the agent explains what happened and drafts an action plan that Taskbase carries out as the person when they confirm. The item's options stay beside it. How the session works is in Agent Sessions — Sessions about a task.

  1. Availability. The item page first asks GET /api/sessions/availability?subject_type=task&subject_id={id}. On the list the check is lazy: loading /attention sends no availability request per item, and the row asks only when its button is clicked.
  2. When every capable runner is busy, the chat still opens: the opening turn shows Waiting for an agent with the time waited, and expires after 10 minutes; the buttons stay usable.
  3. When the person has no runner for the chat (no_own_runner or no_runner_chosen, from availability or from the 409 of the opening request), the button stays usable and leads to /chat?no_runner=<code>&task=<id>&back=<item>. That page says why, with links to Runners and the agent-runner install guide, and that the item's options still work. An administrator who owns no runner (no_runner_chosen) picks one of the runners in scope there and opens the chat on it.
  4. When no runner serves the organization at all, the button is disabled and the reason is shown under it (on the list, under the row); no session is opened.
  5. The chat page. POST /api/tasks/{id}/sessions opens the person's session about the task, or resumes their open one, and the button goes to /chat/{id}, so a reload or a link resumes it. The page has the chat in the centre, starting with the runner and model panel. On the right is the item as on /attention/{event} — its context, pull request and CI, and its options with Confirm, without a second Discuss with an agent — above the plan card. Below 768 px these are two tabs, Chat and Item & plan. The back link returns to the item. Links of the old form /attention/{event}?session={id} redirect to /chat/{id}. The page itself is described in Agent Sessions.
  6. The opening turn. The session starts with a turn that has no message from the person, so the agent explains the item and proposes a plan straight away. On a phone the common case is open, read, confirm. The person can also chat: answer the agent's questions or ask for a different plan.
  7. The plan card, under the item, shows the plan's summary and each action in plain words with its task's title ("Requeue #853 on large", "Close #838 as done — title"). An answer_decision without a persona says what follows: "Answer the decision on #9 — then the project manager plans the follow-ups", or "— then it closes, and #450 starts" (ui/src/attentionSessions.js, decisionThen). Comment and answer bodies can be edited, and ✕ removes an action. The checklist lists steps only a person can do (install something, tag a release, re-run CI, add a secret), each with a link and a tick box. Ticks and edits are edits of the draft and change nothing else in Taskbase. They save against draft_revision; when the agent saved meanwhile, the page offers Re-apply my edit or Use the agent's draft, as on the request chat.
  8. Confirm, at the bottom of the right column, is disabled while a turn runs, when the plan has no action, when a required body is empty, or during a draft conflict. It saves an unsaved edit and posts POST /api/sessions/{id}/confirm with the draft_revision.

What confirm does. Taskbase checks the plan again against the state now: a plan that is stale (for example, the task was requeued meanwhile) or that changed since the person last saw it answers 409, runs nothing, and the page reloads the session. Otherwise the session becomes confirmed, and Taskbase runs the actions in order, each as the confirming person, through the same services as the API routes and choose, so the organization check, the state checks and the audit are those of the web UI. It stops at the first refusal. The page then lists each action's result and becomes read-only:

Result Meaning
done The action ran, e.g. "Comment posted, requeued"
refused A step was refused, e.g. "Comment posted; requeue refused: already queued". Later actions do not run
failed Taskbase failed (a store error), not a refusal
not_run An earlier action was refused or failed
Action Runs as
comment_and_requeue POST /api/tasks/{id}/comments, then requeue, on the model when one is set
add_dependency_and_requeue POST /api/tasks/{id}/requeue-after (Waiting on #n)
answer_decision The answer, then: to persona (on model when set) when the plan names one; else close when an open agent task depends_on it; else to project-manager, no model set (Answering). Then the decision comment
close_done The comment when set, then mark the task done
reassign Change the assignee (and model); a task persona queues the task
requeue POST /api/tasks/{id}/requeue, on the model when one is set
requeue_group POST /api/attention/requeue (Same-cause groups). A refused task refuses the action and stops the plan; the group's other tasks are still requeued

Comments the plan posts are authored by the person and carry Drafted with attention-helper. under their text; on Gitea the usual — person via Taskbase line follows. Nothing is posted as the agent or the runner. The chat transcript is not attached to the task.

Ending another way. A confirmed choice, the board or a merge that resolves all of the task's events closes the session as resolved; the page says so. An abandoned (from the page's header) or expired session shows a short note too.

Which pull request an item shows

An item's pr_url is the first one found of these, and pr_source says which:

Order Where pr_source
1 The event payload's pr_url — the pull request of the run that raised the event event
2 The newest pr_url recorded by any run of the task, of any role (not only implementation) run
3 Only for a person's task (reason decision_needed, blocking_agent_work or decision_unplanned): the newest pr_url recorded by a run of a task it depends_on or is a follow_up_of, in the same organization — typically the analysis whose proposal the person reviews linked_task
4 A pull request URL (…/pulls/N as in Gitea, or …/pull/N as in GitHub) named in the newest run summary of the task that names one; for a person's task, then in the task's description, then in the newest such run summary of a linked task (as in 3) text

Step 4 can find a pull request that a run mentioned without recording it as pr_url. Cross-repository PRs recorded by implementation runs are found in steps 1 or 2, including PRs flagged as unlinked. When none is found, both fields are omitted. The Mattermost notice of a single event resolves its pull request the same way.

A task's pull request and CI

GET /api/tasks/{id}/pull-request returns the item's pull request (or the one named by ?pr=) with its state and CI, read by Taskbase from Gitea and cached for 60 seconds; it reads through, waiting on Gitea when the cache is older. The agent's frame uses it; the context header and the references on the list use only its cache (see Context header). See Gitea Integration — Reading a task's pull request.

Task comments

POST /api/tasks/{id}/comments with {"body": "..."} writes a comment as the signed-in person and returns it with 201.

  • Project linked to a Gitea repository: the comment is posted on the task's issue as the Taskbase bot, ending with — <person> via Taskbase, and stored under its Gitea comment id so the webhook mirror stays idempotent. 502 when Gitea refuses it.
  • Unlinked project (or Gitea sync disabled): stored locally with the person as author.
  • Who: people signed in to Keycloak with access to the task's organization. Agents acting for a run and service API keys get 403; a personal API key counts as its owner. The one exception is a run of a triage task on the task it triages, signed operator via Taskbase triage (What a triage run may do).
  • Body: required, at most 64 KiB (413 above).

MCP exposes it as create_task_comment for people and the project manager; run-scoped agents are refused, except a triage run on the task it triages.

Staying signed in: Remember me

The skatzi realm offers Remember me on the Keycloak sign-in page (components/keycloak/base/skatzi-realm.yaml):

Session Idle Maximum
Plain sign-in 30 minutes 10 hours
"Remember me" ticked 30 days 90 days

A person who signs in once on their phone with Remember me ticked opens notice links straight to the item: the UI still holds tokens in memory only, but the sign-in redirect returns at once from the remembered Keycloak session without asking for a password. The longer session applies to every application in the realm the person uses in that browser; sessions can be ended in Keycloak's account console.

The realm file only applies when the realm is first imported; on the running realm the three settings are applied by hand (step 1 below).

Setup runbook

For an organization's first notices. Needs Keycloak, Mattermost, OpenBao and Taskbase administrator access. Tracked as Taskbase tasks #404 (key) and #370 (the rest).

  1. Remember me on the live realm. In the Keycloak admin console, realm skatzi → Realm settings: Login → turn on Remember me; Sessions → SSO Session Idle Remember Me 30 days, SSO Session Max Remember Me 90 days. Leave the plain session values (30 minutes / 10 hours). Or with kcadm.sh:

    kcadm.sh update realms/skatzi -s rememberMe=true \
      -s ssoSessionIdleTimeoutRememberMe=2592000 -s ssoSessionMaxLifespanRememberMe=7776000
    
  2. Encryption key. Once per instance: write a key to OpenBao at hetzner-mgmt/taskbase/secret-key, property key, value from openssl rand -base64 32. Keep a backup — with a lost or changed key, stored webhooks cannot be decrypted and each must be saved again. The same key seals runner Claude API keys: a key still waiting for its runner cannot be decrypted after the change, so it is not sent, and it expires 7 days after it was set; its owner adds it again. Wait for the tasks-secret-key ExternalSecret to sync (or force it), restart the api deployment, and check its log no longer says TASKBASE_SECRET_KEY not set.

  3. Channel and webhook. In Mattermost, create the channel (e.g. #taskbase-skatzi) with the people who have Taskbase access to the organization as members — every member sees task titles in the notices — and an incoming webhook for it (Integrations → Incoming Webhooks).
  4. Taskbase settings. Organization → Settings → Mattermost notices: paste the webhook URL, set the mentions (e.g. chris31), Save, then Send test notice, and check it arrives as a phone notification.
  5. Phone. Open the test notice's link, sign in once with Remember me ticked, and check that a link opened a day later needs no sign-in.

Troubleshooting

Symptom Cause
Saving the webhook answers 503 "no encryption key" TASKBASE_SECRET_KEY is not set in the API (step 2)
Test notice answers 503 "cannot be decrypted; save it again" The key changed since the webhook was saved: save it again
Test notice answers 502 Mattermost refused or could not be reached; the message says why (without the URL)
Notices without a link PUBLIC_BASE_URL is unset in the API
No notice for an event The organization has no webhook, runner-offline warnings are muted (for runner.offline), the event was raised before the webhook was set, it resolved within the grouping window, or the hourly limit was reached (it follows later). The page lists it either way, except a muted runner.offline event
A link asks to sign in again Remember me was not ticked, the session passed 30 days idle or 90 days, or the live realm lacks the setting (step 1)

API

Endpoint Who Purpose
GET /api/attention[?organization_id=] Authenticated callers except agents acting for a run; filtered to the caller's organizations (administrators and service API keys see all) Open events and those resolved in the last 24 hours, newest first, at most 200 events. The events are then merged into one item per task (runner events stay one item each): the item takes the id, kind, reason and payload of the task's newest task.needs_attention event (else its newest event), question from the newest task.question event when that one has none, and event_ids lists every merged event, newest first (a runner item's is [its id]). Each item has id, event_ids, kind, state, resolved, reason, question, pr_url and pr_source (below; both omitted when no pull request is found), the payload, and task, last_run or runner. task carries the task's decision (with summary, and choices on a decision that has them) and, while the decision is open and has no options, decision_source (below). Task items have options and, in the same order, choices (Options and Choose); runner items have null for both. An open task item that an agent triage level holds has held_by. runner.offline items are left out when every organization that sees the runner, within the filter, has muted them. 403 for an organization the caller cannot read
GET /api/organizations/{orgId}/mattermost Global administrators {organization_id, webhook_set, mentions, warn_runner_offline, updated_at}
PUT /api/organizations/{orgId}/mattermost Global administrators {"webhook_url"?, "mentions"?, "warn_runner_offline"?}; an absent or null field is kept, "webhook_url": "" removes the webhook. http/https URLs only
POST /api/organizations/{orgId}/mattermost/test Global administrators Post a test notice. 409 when no webhook is set
POST /api/tasks/{id}/requeue-after People with the task's organization (agents 403) Waiting on #n: {depends_on, comment?}. Answers with the status of the first refused step (else 200), failed_step, error, and every step's result (done, refused or skipped)
POST /api/attention/{id}/choose People (agents 403) Choose an option for the task item that event id belongs to: {option, note?}, where option is an option or a choice's label. Answers 200 with every step's result when all are done; 400 without an option; 404 for no task item (runner items cannot be chosen); 409 when the item is resolved or the option is no longer offered; otherwise the status of the first refused step, with every step's result
POST /api/attention/requeue People (agents 403) Same-cause groups: {task_ids (1–20), model?}. A result per task: requeued, skipped (no open item) or refused with the reason
GET /api/tasks/{id}/pull-request[?pr=] People and agents of the task's organization A task's pull request and CI
POST /api/tasks/{id}/sessions People with the task's organization Discuss with an agent: open or resume the person's session about the task; 409 without an open item
GET /api/tasks/{id}/comments The task's organization The task's comments
POST /api/tasks/{id}/comments People with the task's organization, and a triage run on the task it triages Write a comment
POST /api/tasks/{id}/gate-verdict The run of gate task id only (403 otherwise; 409 once a verdict is in or the owner acted first) The decision gate: {verdict: decided, answer, reason, policy_line} or {verdict: forward, recommendation, uncovered}
GET /api/organizations/{orgId}/gate-decisions?task_id=&limit= The organization The decision record
POST /api/organizations/{orgId}/gate-decisions/{id}/policy People only {line}: append a line to the gate role's mandate, once per forwarded record (409 otherwise; 400 past the mandate's length)

pr_url and pr_source

pr_url is the item's pull request and pr_source where it was found: event, run, linked_task or text, in that order of preference (Which pull request an item shows). A task item whose headline event has none takes them from the newest merged event that has one.

Context fields

Each task item also has:

Field Content
task.project_name, task.repository, task.epic {id, title}, task.assignee, task.assignee_type The context header
last_run.pr_url, runner_id, runner_name, adapter, failure_reason What the last run did
pull_requests The item's PR, then the last run's if different: url, repository, number, title, state, merged, mergeable, ci_state; only url and pending: true while the state is not read yet
references Up to 20 resolved references: {kind, ref, title, state, done, url, …}
group {key, label, count} for same-cause items; keys look like org=<id>:<rule>:<cause>
waits_on {id, project_id, title, done}: the task the item waits for
options What the person may choose, recommended first: at most 4, or a decision's up to 6
choices options for a picker, one {label, description, recommended} per option in the same order: a decision's structured choices, else read from the plain options (Structured choices and plain options)
held_by The triage level that has the item (below); omitted when none does

held_by

Set on an open task item while an agent triage level holds it (With a triage level gives the rule); omitted otherwise. A merged item takes it from its headline event (merge in api/internal/attention/group.go).

Field Meaning
task_id, project_id The triage task, for the link to its board
title The role's roster title (organization_roles.title), else the persona's name (agent_types.name), else the persona's slug
"held_by": {"task_id": 1901, "project_id": 2, "title": "Tech lead"}

While the decision gate works on the item, held_by names the gate task and the gate role's title, with kind gate.

The values in this example are made up; the shape is the one in HeldBy (api/internal/attention/model.go) and the OpenAPI document.

decision_source

Set on an attention item's task while its decision is open (question set, no answer) and has no options. It names the decision task's latest depends_on predecessor in the same organization — the one with the latest finished run, typically the analysis whose agent was to fill in the options:

Field Meaning
task_id, project_id, title The predecessor task, for the link to its board
done Whether the predecessor is done
run_id, summary Its last finished run and that run's summary, cut to 4,000 characters; omitted before it has one

The page shows it under Where the options come from (On the page and in Mattermost).