Repository navigation
Description
Depends on: #2547 (engine provenance), #2526 (the loader the harness runs from), #2529 (engine API order)
Removes shortcut: inline MCP servers in definitions bypass the broker, because the harness does not run definitions from the broker's loader (#2451)
Removes shortcut: registration names the loader's revision, not the exact revision the session runs: named definitions go with no source, the built-in main with no revision (#2545)
Removes shortcut: under an operator harness_context policy, only built-in definitions register, so named sessions and helpers are refused (#2527)
Removes shortcut: the harness resumes every subagent on the default explorer, so a named helper whose credential is gone cannot be resumed (#2555; see the comment below)
Removes shortcut: the harness works out the gateway tools of a named helper, or of a session started with a named definition, from its definition again, rather than reading the ceiling the broker recorded (#2842, #2938)
Problem
The harness discovers the operator's definitions itself, so the agent it runs can differ from the definition the broker checked. Sessions keep only their main definition's name, so a source edit can silently change a running agent. Inline MCP servers bypass the broker.
Implements
- agent-definitions.md: Harness configuration and broker authority: inline entries dropped
- agent-definitions.md: Loading definitions: loader output to the harness, fixed selection, registration by reference, built-ins
- agent-definitions.md: Identity continuity across runs and restarts: source-edited and restoration rows
- credentials-and-lifecycle.md: (4) Agent-instance JWT-SVID: check 3's reference
Scope
- Landing order: the harness/composition PR, then the engine-session PR.
- Harness/composition: in broker mode the harness builds the operator's definitions from the loader's records and exact bytes, refusing a digest mismatch; a loader failure is reported, never replaced by local discovery. The bytes may hold inline server headers: never logged or projected. Inline servers are dropped from every source's definitions; references to configured servers stay. Since refactor(agentfs): parse agent definitions with agentdef #2864 the harness and the loader parse with the same
agentdef. The check is on the source content digest (the exact bytes). The accepted definition digest also matches when both sides use the same canonical form, which the record'sdefinition-formmetadata names. A different form version, possible once the broker runs as its own service, is not a mismatch. - Engine session: each agent's reference (source, name, revision) is persisted and registered; source and revision become required. This published engine API change lands after Move broker state out of the engine Session #2529 and AgentDefSource returns definition provenance (engine) #2547, rebasing on Helper agents: their own registered identity and broker MCP tools #2555 if that landed first. Helpers' definitions reach the host through
port.ChildSessionInfo.DefinitionNameandagent.MemberBuild.DefinitionName(feat(engine): let a child store admit each child it publishes #2912); the reference (source and revision) belongs there too, and the server'sIdentityDefinitionslookup (a shortcut noted ininternal/adapter/server/service.go) goes away. - Existing sessions have no reference: the PR assesses stored-data compatibility and documents upgrade behaviour.
- Not here: repository definitions at the broker (Full definition loader and registration rules #2551); the hand-over across processes (Broker over gRPC, authenticated as the mecak8s workload #2559). Related: Session-scoped agent identity: persist and enforce authority across all engine-rebuild paths #1796.
Decide before starting
- Can the harness rebuild a built-in from an earlier release, whose revision is no longer shipped? If not, restoring after an upgrade fails closed.
D4 (asked on Per-agent registration and identities, switched on #2527): does check 3 apply on re-registration?Decided in docs(agent-identity): keep a re-registered instance's revision, and pin a schedule's definition #2866: an instance registering again keeps the revision it registered with (check 7).
Done when
- In broker mode, agents match the loaded records; a digest mismatch is refused, with a test; repository definitions are still discovered.
- A test shows inline servers dropped with a diagnostic and never connected.
- New sessions persist and register their exact reference,
system/mainincluded; an unrebuildable revision fails closed on restore. - Non-broker mode is unchanged.
Earlier notes: #2549 (closed, merged here).
Activity
[-]Broker mode: the harness uses loader output[/-][+]Sessions run and register the exact definition revision[/+]rdimitrov commentedon Nov 20, 2026
A gap for this ticket: resuming a subagent should keep its original definition
The design says "A resumed child session keeps its original definition" (Relationships and lifetimes). Today the engine resumes every subagent on the default explorer engine, whatever it ran first ("a resumed subagent continues on the default explorer engine"). Child sessions also record no definition, so a resume could not recover it.
With the identity broker on, #2913 (part of #2555) admits a resumed subagent again before it runs:
system/explorer, the definition it now runs. The broker refuses that for an agent it recorded with another definition (check 7), so the resume fails.That refusal is correct for what runs today. The fix belongs here, since it needs sessions to record exactly which definition they run:
Changing the resume engine is an engine behavior change for every deployment, not only broker mode, so it needs the engine compatibility classification.