Repository navigation
feat(platform): give projects without agents a standard agent - #4029
Merged
Merged
Conversation
…ard agent Members cannot create agents, so a project without one left them no way to hand it work. A `standard_agent` governance policy, on by default, now provides one: the first task given to it in a project without agents of its own sets up a managed project agent (0145: `managed`, one per project), with the project's document skills and no connectors, tools or secrets. Nobody edits it; every start reads the policy again, resolves its runtime and model for the person the run acts for (chat Auto's standard band, or the admin's pin, which never falls back), writes the result back to the row and refuses with the policy's reason when it cannot run (STANDARD_AGENT_OFF, STANDARD_AGENT_UNAVAILABLE). The retry job retires such a refusal. The chat hand-over note tells each person when a project's tasks go to it.
In a project without agents of its own, Assignee offers Standard agent to everyone who may assign the task, and the chat hand-over lists such projects as startable and pre-assigns it. The project's Agents tab marks it Standard, without an edit action, and its empty state says where tasks go. Governance > Models gets a Standard agent section: the switch, the agent type, the model, the instructions, and what it runs on for the viewer, with a repair path for a malformed policy. Refusals map to localized messages that say who can fix them.
The Models page explains the Standard agent section; Project agents, Tasks, Chat basics, the member projects walkthrough and Understand project agents say where it is offered and how it behaves; the self-hosted provider reference describes governance/standard-agent.yml. Three new captures: the governance section, Assignee offering it, and the Agents tab row.
…uites GOV-F49–F51 and GOV-B18–B19 cover the Standard agent section, the switch, a pin and a malformed policy; PROJ-F37–F38 the managed row on the Agents tab; TASK-F61 and TASK-B37 a Member's hand-over and a refusal; CHAT-F56 the chat hand-over. The no-agent boxes (CHAT-F52, CHAT-F55, CHAT-B20, PROJ-F36, TASK-F55, TASK-A14) now say they hold with the standard agent switched off. The error-code map and the automation register gain their rows.
ProjectAgent answers managed (required) for the organization's standard agent; its PUT documents PROJECT_AGENT_MANAGED, and the review relay, which can start the task's agent, documents STANDARD_AGENT_OFF and STANDARD_AGENT_UNAVAILABLE. The schema fingerprint moved, so the contract version moves to 3.9.0 with its changelog entry.
An adapted read answers a 4xx as an AppError, so the editor's instanceof BackendApiError check never saw GOVERNANCE_POLICY_INVALID and locked the section instead of offering the repair. It reads the code now; Retry asks both the policy and what it resolves to for the viewer (useStandardAgentQuery).
…swered While the availability read was in flight the dialog grouped the projects and mounted the task form as if there were no standard agent, then remounted it assigned, dropping what was typed. It waits for the first answer now, as for the project list; a failed read goes on without it.
…n mention A comment or task that @mentioned the standard agent while it could not start for its author (switched off, no model they may use) failed whole with the kick's refusal. The mention lane now kicks inside a savepoint: the refusal takes the reassignment back and the text saves as a plain mention, like the lane's other refusals. The late-steer fallback answers it as a refusal, never a throw, and the composer's chip says the agent won't respond (standard_agent_unavailable).
The start's write-back takes the agent row with FOR UPDATE SKIP LOCKED: the kick holds the task's lock while a delegated start takes the agent's first, so waiting could deadlock; a held row is left for the next start (proved on real Postgres in checkStandardAgent). The setup lists skills without creator attribution, so no audit-trail read runs in the serializable transaction that writes one, and a save of the standard agent answers the edit gate before PROJECT_AGENT_MANAGED.
… reach Assignee offers the standard agent only to someone it can start for, so TASK-B37, GOV-B19 and the error-code map now look for the missing option and the start's toast; GOV-F51 adds the mention that stays plain while it is switched off.
yannickmonney
force-pushed
the
feat/org-standard-agent
branch
from
October 1, 2026 07:11
707bb21 to
ca58362
Compare
This was referenced Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third of three PRs for the customer finding "a small task (3 files + prompt) can't be done from chat; the chat points to an agent that doesn't run, and a Member can't create or adjust agents". PR A (#4017) removed the dead ends, PR B (#4023) made the chat hand-over finish. This PR closes the remaining gap: a project without agents of its own now has the organization's standard agent, so a Member always has an agent to hand work to.
What changes
standard_agentgovernance policy (governance/standard-agent.yml):enabled, optionalharness, optional model pin (providerSlug+modelId, both or neither), optionalinstructions. A missing file means on and automatic; new organizations are seeded withenabled: true. A malformed file reads as unavailable, never as on.managed(migration 0146, at most one per project via a partial unique index; concurrent hand-overs create one row, counted once). It gets the project's document skills (docx,pptx,xlsx,pdf) and no connectors, tools or secrets. Nobody edits it (PROJECT_AGENT_MANAGED); Editors can delete it.kickAgentRunresolves the runtime and model for the person the run acts for, writes a moved serving back to the row, and refuses without queuing when it can't run:STANDARD_AGENT_OFF(403) orSTANDARD_AGENT_UNAVAILABLE(409,data.reason:no-model/pin-unavailable/harness-invalid/unreadable). The retry job retires such a refusal.ProjectAgent.managed(required);PUTdocumentsPROJECT_AGENT_MANAGED; the review relay documents the two standard-agent refusals.Product decisions for the owner
The owner delegated these calls; each is easy to reverse:
STANDARD_AGENT_NOT_NEEDED). Once Editors add their own, the standard agent is no longer offered there; the one already set up stays assignable until someone deletes it.managed.Verification
checkStandardAgentinbackend:integration, passes 7/7 on a throwaway database: the migration's shape, two hand-overs at once creating one agent counted once,PROJECT_AGENT_MANAGED, a start's write-back skipping a row another start holds,STANDARD_AGENT_NOT_NEEDED, switched off with no run row, and a malformed file reading as unavailable.lint:links,lint:manual, check-guide, docs tests (222), i18n (188);Review follow-ups
An independent adversarial review of the diff found no blockers and no authorization problems. Fixed in this PR:
standard_agent_unavailable).AppError, so itsinstanceofcheck missed it. It reads the code now, and Retry re-asks both the policy and what it resolves to.FOR UPDATE SKIP LOCKED, which avoids a lock-order cycle with delegated starts; proved on real Postgres.PROJECT_AGENT_MANAGED.All of these were observed live on the rig as well:
Known limits, unchanged on purpose:
Notes for merging
0145and boxGOV-F49, so this PR's migration is0146and its governance boxes areGOV-F50–GOV-F52. Open PR fix: name budget-rule keys, explain empty chat replies, land docs labels #4012 holdsGOV-F48; itsCHAT-F53/CHAT-F54already collide with feat(platform): hand a chat's work to a project agent in one step #4023 on main and need renumbering there.