Skip to content

Decision: which task runs should start on the shared engine, beyond a person starting the standard agent? #4876

Open

Description

@yannickmonney

Summary

A task run starts on the shared engine only when every one of the conditions below holds. Everything else starts a full workspace and its coding-agent harness, as before. This issue lists the conditions, the reason each has in the code, and what a wider rule would have to answer. It asks which conditions should change and proposes nothing.

Part of #4879.

The conditions today

In kickAgentRun (backend/domains/tasks/agent-runs.ts:418), a run is native only when serving.engine === 'native', args.handoff === undefined, args.startedVia === undefined and startedByPerson(args.startedBy).

Condition What it excludes Where Reason in the code
the agent is the managed standard agent every agent a person created in a project, whatever it is equipped with standardAgentServingForKick, backend/domains/projects/standard-agent.ts: if (agent === undefined | !agent.managed) return passthrough (engine: 'harness', :538) not stated. The engine offers retrieval and work tools only: no connector bridge, no platform tool grants, no secrets, which a configured agent may rely on
no runtime is pinned an admin who pinned a runtime for the standard agent standard-agent.ts:89 "An Admin who pins a runtime chose it for every run, so it is never native"
the chosen model is served directly a model only a runtime can run (a provider subscription's) standard-agent.ts:89 "has no direct path, so it is never native either"
started by a person: user:, api-key: or a bare user id schedules, webhooks and event firings (trigger:<id>), and anything unparseable startedByPerson, agent-runs.ts:364; lib/shared/run-starter.ts "the native engine acts for a person, as a chat does" (agent-runs.ts:412-417)
not started by an automation or another agent (startedVia) an automation step's start and a delegated start agent-runs.ts:421 same comment
not a retry after a hand-over (handoff) the retry of a run that already moved to the harness agent-runs.ts:420 a native start would repeat the work already done

What a run on the shared engine is

  • One job, task.agent_native: no retry, expiry 3,600 s, heartbeat 60 s, at most 4 per organization (NATIVE_RUNS_PER_ORG, backend/jobs/tasks.ts:842). It holds none of the harness fleet's worker slots.
  • Tools: the three retrieval tools, the five work tools and use_workspace. No task tools, no connectors, no secrets (see Epic: one agent engine for chat and tasks — what is still separate #4879).
  • It acts for a person: model access, budget hold, usage ledger, files and sandbox ownership are the starter's.
  • Cost, from a local rig on 2026-10-11 (released 0.5.86 images): creating a default-profile session takes about 0.3 s, and an agent-profile session without Docker-in-Docker about 0.3 s and 18 MiB idle. Container creation is not what a harness run costs. What it adds is the coding agent's CLI start, a system prompt on every round, a gateway key, MCP and staging, and a worker slot; those were not measured.

What is not known

  • The share of runs by origin in real deployments, and how many of the excluded runs would have fit the engine.
  • Time to first output, native versus harness.

What a wider rule would have to answer

  1. Whose authority acts for a run that nobody started? A trigger-started run already answers to the agent's creator for model access (standardAgentServingForKick: "a trigger's (trigger:<id>), which answers to the agent's creator"). Budget, file ownership and sandbox ownership have no such rule yet.
  2. Where does the transcript go, and who sees it? Native transcripts are bare task_run threads owned by the starter.
  3. Which tools do configured agents need? Connectors, platform tool grants and secrets come through the harness bridge (Improvement: knowledge search and image generation exist twice, once for chat and shared-engine task runs and once for the harness bridge #4875); the engine has none of them.
  4. Limits. The 1-hour expiry and the 4-per-organization cap were sized for person-started runs.
  5. Visibility. How a schedule-started run appears in the run card, notifications and retention.

Options (not exhaustive, no preference stated)

  1. Keep the rule: the standard agent, started by a person.
  2. Add trigger-started runs of the standard agent, acting for the agent's creator, as model access already does.
  3. Let a person-created agent opt in when its configuration needs nothing the engine lacks (no connectors, grants or secrets).
  4. Extend the engine's tools first (Improvement: knowledge search and image generation exist twice, once for chat and shared-engine task runs and once for the harness bridge #4875), then widen routing to the agents that need them.
  5. Let an automation step choose the engine per step.

Questions

  • Which excluded classes matter in practice: schedules, member-created agents, automations?
  • Is "acts for a person" the right invariant, or may an organization-level principal act?
  • Should an admin control routing (a policy), or should it stay derived from the agent's configuration?

Related

#4844 (introduced the routing), #4878 (what an admin can switch for runs on the engine), #4877.

Observed at main a83e645e27.

Activity

  1. added
    needs discussion
    improvement
    service: platform
    on Oct 12, 2026
  2. yannickmonney commented on Nov 14, 2026

    @yannickmonney
    ContributorAuthor

    Decision

    Rule. A task run is routed by the authority it acts under, decided by the resolver the harness already uses, run-authority.ts. A run starts on the shared engine when all of these hold:

    • the agent's serving can be native;
    • it is not a retry after a hand-over;
    • it carries no agent-to-agent contract: no delegated start from another agent and no review batch. Those rely on task tools the engine lacks;
    • its starter is a person (user:, api-key:, bare id), an enabled schedule bound to the project (trigger:<id>), or the project's switched-on dispatch (dispatch:<projectId>).

    An automation step's start is routed by the starter it carries. Webhook and event firings stay on the harness.

    Unattended native runs (schedule, dispatch):

    • Spend: the automation subject, under the agent and the project (as TASK-R47). No member's budget is touched.
    • Model access: the agent's creator, for schedule and dispatch alike, exactly as today.
    • Reads: retrieval, skills and the task's files are project-scoped through the TASK-R82 rules, never through a person's chat viewer. Every tool call checks again that the schedule or dispatch may act, and the turn ends when it may not.
    • Lost authority before launch: a schedule run moves to the harness (confined); a dispatch run fails without running (TASK-R47).
    • Sandbox: the run's own. Transcript: a task_run thread in nobody's chat list, read through the run card by project readers.
    • Cap: a separate 4 per organization. Expiry and TASK-R12 are unchanged.

    Person-created agents: work this way only by an explicit per-agent opt-in, off by default, and only without connectors, grants or secrets and with a directly served model. No admin routing policy is added. What native runs may do is decided in #4878.

    Answers:

    Rationale. The rule widens only where the code already enforces who acts for a run, and reuses the harness's authority and read scope instead of a second copy. Model access stays where it is today, so nobody's model entitlement moves. Agent-to-agent starts stay on the harness because their prompts require task tools the engine does not have. Before-launch loss of authority follows TASK-R47 per kind. The opt-in keeps shell-written agents from silently switching engine.

    Implementation units (all on feature-train):

    1. The native engine acts under a run authority (budget, reads, rechecks, before-launch rules, transcript ownership). No routing change yet. (M)
    2. A separate concurrency cap for unattended native runs. (S)
    3. Route schedule, dispatch and automation-step starts of the standard agent to the engine. Delegated and review-batch starts stay on the harness. Spec, docs in every locale, a manual box. (M)
    4. Per-agent opt-in for person-created agents. (M)
    5. Record time to first output per run, by engine and origin. (S)

    Cross-issue amendments (decisions taken together with #4879):

  3. added
    agent-ready
    and removed
    needs discussion
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyimprovementservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions