Skip to content

feat(platform): give projects without agents a standard agent - #4029

Merged
yannickmonney merged 14 commits into
mainfrom
feat/org-standard-agent
Oct 1, 2026
Merged

yannickmonney merged 14 commits into
mainfrom
feat/org-standard-agent

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Policy. A new standard_agent governance policy (governance/standard-agent.yml): enabled, optional harness, optional model pin (providerSlug + modelId, both or neither), optional instructions. A missing file means on and automatic; new organizations are seeded with enabled: true. A malformed file reads as unavailable, never as on.
  • The managed agent. The first time someone gives a task to Standard agent in a project without agents of its own, Tale sets up a project agent marked 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.
  • Every start re-reads the policy. kickAgentRun resolves 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) or STANDARD_AGENT_UNAVAILABLE (409, data.reason: no-model / pin-unavailable / harness-invalid / unreadable). The retry job retires such a refusal.
  • UI. Assignee offers Standard agent in a project without agents (Members included). The chat hand-over lists such projects as startable and pre-assigns it. The Agents tab marks the row Standard, without an edit action, and its empty state says where tasks go. Settings > Governance > Models gets a Standard agent section: the switch, agent type, model, instructions, and what it runs on for the viewer, with a repair path for a malformed file. Refusals map to localized messages that say who can fix them (EN/DE/FR).
  • Hand-over note. The assistant's per-person note says that in projects without agents of their own the standard agent takes the task.
  • REST 3.9.0. ProjectAgent.managed (required); PUT documents PROJECT_AGENT_MANAGED; the review relay documents the two standard-agent refusals.
  • Docs (EN/DE/FR). Models page section, Project agents, Tasks, Chat basics, the member projects walkthrough, Understand project agents, the self-hosted provider reference (policy file) and the API reference. Three new captures: the governance section, Assignee offering it, and the Agents tab row.
  • Manual. GOV-F50–F52, GOV-B18–B19, PROJ-F37–F38, TASK-F61, TASK-B37 and CHAT-F56. 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 (GOV-F52). Error-code map and automation register rows added.

Product decisions for the owner

The owner delegated these calls; each is easy to reverse:

  1. On by default. A missing policy file means on, and new organizations are seeded on. Admins can turn it off under Governance > Models.
  2. Only where a project has no agents of its own. A project with its own agents is left to them (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.
  3. Managed agents are read-only and removable. Their settings come from the policy, so nobody edits them per project. Deleting one is safe: the next hand-over sets it up again while the project has no agents.
  4. Automatic means chat Auto's standard band. It runs on Claude Code, or on the harness a subscription model is bound to.
  5. Model access follows the person who starts the run. A trigger resolves for the agent's creator. A pinned model never falls back: a person who may not use it gets a refusal that names the reason.
  6. Any project reader can set it up. That's needed so Members can use it; the assignment itself still requires the usual work rights. Setting it up grants nothing beyond the document skills.
  7. Naming and equipment. The agent is named in the organization's default language. It gets document skills only: no connectors, tools or secrets.
  8. No REST door to set it up. REST task intake takes no agent assignee. REST reads expose managed.

Verification

  • Unit, route and component tests across the backend, the editor, the picker, the hand-over dialog, the Agents tab and the note.
  • A real-Postgres integration lane, checkStandardAgent in backend: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.
  • Local gates are green:
    • typecheck (platform and shared), oxlint, oxfmt, knip, SAST (0 findings);
    • lint:links, lint:manual, check-guide, docs tests (222), i18n (188);
    • server tests (13,562 after the rebase), pii (67,260), browser (307);
    • UI (5,076 after the rebase): the latest full run, on a machine at load average ~64, had six timeouts in files this PR does not touch; all pass when run alone. The previous full run on the same code, before the rebase, passed 5,058 of 5,058.
  • Observed live on a mock-gateway rig:
    • a Member assigns Standard agent from the picker, the managed agent is created and the run settles;
    • a pinned model heals the row on the next start;
    • switched off, starts are refused with the localized toast;
    • the chat hand-over pre-assigns it, and the note's standard-agent branch appears in the prompt;
    • deleting it brings back the empty state.

Review follow-ups

An independent adversarial review of the diff found no blockers and no authorization problems. Fixed in this PR:

  • Mentions. A comment or task that @mentioned the standard agent while it couldn't start for its author failed whole. The mention lane now kicks inside a savepoint, so the comment saves as a plain mention and the reassignment rolls back. The late-steer fallback answers a refusal instead of throwing, and the composer chip says the agent won't respond (standard_agent_unavailable).
  • Malformed policy. The Governance editor never offered to repair a malformed policy: adapted reads answer 4xx as an AppError, so its instanceof check missed it. It reads the code now, and Retry re-asks both the policy and what it resolves to.
  • Hand-over dialog. It could open unassigned and then remount assigned while availability loaded. It now waits for the first answer.
  • Row writes.
    • The start's write-back uses FOR UPDATE SKIP LOCKED, which avoids a lock-order cycle with delegated starts; proved on real Postgres.
    • Setup lists skills without creator attribution, so there's no audit-trail read inside the serializable transaction that writes one.
    • Editing the standard agent answers the edit gate before PROJECT_AGENT_MANAGED.
  • Manual boxes. Assignee only offers the standard agent to someone it can start for, so the refusal boxes now look for the missing option and the start's toast.

All of these were observed live on the rig as well:

  • the malformed file repaired from the editor;
  • a comment mentioning the switched-off standard agent saved as a plain mention, with no run and the assignee unchanged;
  • the chip reading the new message.

Known limits, unchanged on purpose:

  • A steer restart keeps the run's model, as for every agent.
  • With Automatic, the managed row shows the model of the last start, which can differ between people.
  • The chat note's availability read adds one policy read per in-app turn.

Notes for merging

…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
yannickmonney force-pushed the feat/org-standard-agent branch from 707bb21 to ca58362 Compare October 1, 2026 07:11
@yannickmonney yannickmonney changed the title feat(platform): give projects without agents the organization's standard agent feat(platform): give projects without agents a standard agent Oct 1, 2026
@yannickmonney
yannickmonney merged commit feb83e4 into main Oct 1, 2026
82 of 83 checks passed
@yannickmonney
yannickmonney deleted the feat/org-standard-agent branch October 1, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant