Repository navigation
Closed
Labels
agent-readyMaintainer-approved for the Tale agent fleetfeatNew featureservice: platformPlatform service
Description
Summary
An agent can set a label only when it creates a task. It cannot add or remove a label on an existing task, so work an agent should route by label — a dispatch gate's labels, a dispatch's label filters — can only be labelled by a person.
What the repo says today (main 56c44e3)
- The agent tool that changes an existing task's fields is
task_update_metadata; it accepts{taskId, priority?, agentId?, expected: {priority?, assignee?}}and refuses any other field (services/platform/backend/core/node_only/sandbox/workspace_domain_tools.ts:1658-1690, the refusal text at:1684). - A project dispatch's gates hold the ready work carrying their labels, and its label filters narrow ready work by label (TASK-R51, TASK-R41;
packages/shared/src/schemas/project-dispatch.ts).
What was observed
Preparing Tale's own fleet for native dispatch, a ci gate holds the work labelled optional-ci while the CI queue is full. The fleet's manager agent decides which work produces optional CI, but it cannot put the label on an imported or existing task; only tasks it creates can carry it, so the gate governs less than the policy intends unless a person labels the rest.
Not examined: whether other agent tools (automation steps such as task.upsert) can set labels on an existing task.
Constraints
- Labels are project-scoped; a label an agent sets must exist in the project (dispatch refuses unknown labels, TASK-R48).
- Agent writes go through the same permission checks as people's (a run a Member started keeps to its task).
- Changing a label can change what dispatch starts next; the compare-and-set style of
task_update_metadata(expected) exists to keep concurrent agents from overwriting each other.
Options
- Let
task_update_metadataadd and remove labels, with the current labels inexpected. - A separate agent tool for labels (
task_set_labels), with its own compare-and-set. - Keep labels people-only and let gates and filters match something agents can set (a priority band, a field).
Questions
- Should an agent be able to remove a label a person set?
- Should label changes by agents show in the task's timeline like other agent edits?
Metadata
Metadata
Assignees
Labels
agent-readyMaintainer-approved for the Tale agent fleetfeatNew featureservice: platformPlatform service
Activity
tale-review-bot commentedon Oct 31, 2026
Decision: an agent may add and remove labels on an existing task through a label tool of its own, and only for the labels an admin names in that agent's grant. Every such change shows in the task's timeline, with the agent as its actor.
The question. May an agent change the labels of an existing task? If so: which labels, may it remove a label a person set, and do its changes show in the timeline? (TALE-203, tale#4990)
What the code does today (
tale-project/talemaindf6105cef08a78084439c029d5917611c4adcf54)services/platform/backend/db/migrations/0009_tasks.sql:32). Nothing records who put a label on a task.packages/shared/src/schemas/project-dispatch.ts:103-107,:193-214;services/platform/backend/domains/tasks/dispatch-pass.ts:402-404). So whoever may removeholdorneeds-humanmay restart work a person paused.packages/shared/src/agent-tool-grants.ts).task_update_metadatachanges priority and owner with a compare-and-set (services/platform/backend/domains/tasks/agent-metadata.ts:65-82). It writes the timeline and the audit with the agent as actor (services/platform/backend/domains/tasks/service.ts:2113-2134).task_upsert_by_external_refreplaces the list and creates names the project lacks (services/platform/backend/domains/tasks/external-ref.ts:451-460,:565-569). The timeline records nothing of it (:607-615,:638-645). That is filed as tale#5216, below.Options weighed
task_update_metadata. Every agent that holds that grant today, for priority or owner, could change every label after an upgrade,holdandneeds-humanincluded, without an admin granting it.Decided: option 2, scoped to named labels. It widens what agents may do, so it takes the narrowest form:
task_update_metadata. No existing grant includes it, so nothing changes on upgrade.hold,needs-human, or any label used to pause work. This answers the issue's first question: an agent removes a label a person set only when an admin named that label in its grant. A rule based on who set each label would need new data on every task, and would still let one agent remove a pausing label that another agent set.expected. A mismatch is refused with the existing stale-metadata error.task_update_metadatadoes (services/platform/backend/core/node_only/sandbox/workspace_domain_tools.ts:1740-1743).assertTaskWorkable,service.ts:427-450).labels.changedto the timeline with the agent as actor. It also writes an audit row marked as an agent's, as a priority change does today (service.ts:2113-2134). This answers the issue's second question: yes.Done means
optional-cican add and removeoptional-cion an existing task of its project. The timeline shows the change and the agent.expected;services/platform/tests/manual/suites/tasks.md:782).task_set_labelsis fine);add/remove, or the whole list;Closes #4990.Line: feature
Priority p3: an improvement without a
priority:label.Filed: tale#5216, the external-ref path's missing timeline entry (
agent-ready, Line: stable). It is the part of #4990's second question that is a fix of whatmainships.What would change this decision: people who run a Tale fleet answering that agents need to manage every label of a project. The grant could then take "all labels" as an explicit choice, still off by default.
tale-review-bot commentedon Oct 31, 2026
Kind corrected (Lead, TALE-203, run of 2026-10-31 18:00 UTC): #4990 now carries
featinstead ofimprovement.feat("add a capability Tale does not have"), notimprovement("improve what works").feat.tale-code-bot commentedon Nov 2, 2026
TALE-203 implements this as the Lead decided: a new project-agent tool
task_set_labels, off by default, that adds and removes only the labels an admin grants that agent in the project-agent dialog (or throughlabelGrantson the REST agent doors). It answers to the task's whole current label list, never creates a label, refuses a member-started run, and records each change on the task's timeline and in the audit log under the agent's name. The change is on branchfeat/agent-task-labelsfor review and closes this issue when its commit lands.A further part is filed separately: #5281 lets managed configuration declare an agent's label grant, which no declaration kind can do yet.
feat(platform): let project agents set their granted task labels
feat(platform): let project agents set their granted task labels
feat(platform): let project agents set their granted task labels
feat(platform): let project agents set their granted task labels
tale-code-bot commentedon Nov 2, 2026
Done on the feature line: feature train #5297 landed on
release/0.6by rebase at 2026-11-02 09:37:43 UTC. This issue's change is commit2d5e7c0afa1437f0f7222fe13ad718085cf5545f(feat(platform): let project agents set their granted task labels) onrelease/0.6, and it ships with Tale 0.6.0. GitHub closes issues itself only for commits that reachmain, so the feature-train role closes this one now. Board task: TALE-203.feat(platform): let project agents set their granted task labels
feat(platform): let project agents set their granted task labels
feat(platform): let project agents set their granted task labels
feat(platform): let project agents set their granted task labels
feat(platform): let project agents set their granted task labels
feat(platform): let project agents set their granted task labels
feat(platform): let project agents set their granted task labels
feat(platform): let project agents set their granted task labels
feat(platform): let project agents set their granted task labels
feat(platform): let project agents set their granted task labels
feat(platform): let project agents set their granted task labels
feat(platform): let project agents set their granted task labels
feat(platform): let project agents set their granted task labels
feat(platform): let project agents set their granted task labels
feat(platform): let project agents set their granted task labels