Skip to content

Prepare each Executor from one request - #533

Merged
SaladDay merged 5 commits into
aos/cutoverfrom
aos/r6-prepare-request
Oct 8, 2026
Merged

SaladDay merged 5 commits into
aos/cutoverfrom
aos/r6-prepare-request

Conversation

@SaladDay

@SaladDay SaladDay commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

The Core–Runtime wire carries only what Core decides, and each Executor is prepared from one request.

Wire (internal/agentdaemon/proto, docs/runtime-protocol.md)

  • Deleted: AgentStateKey (the Runtime derives the state key from the Session ID), LocalEnvironment.Capabilities, NetworkAccess and AllowedDomains (the owner knows its installed capabilities; the workspace network is enabled by construction), the prepared configuration's RunID and Input (they arrive in execution_start), the unread heartbeat fields Timestamp, ActiveRequests and DaemonVersion, DonePayload.Transcript, and every json:"-" field.
  • proto.Version is unchanged; the final merge bumps it once.

Runtime–Harness (apps/daemon/internal/agent/harness.go, harness-onboarding.md)

  • agent.PrepareRequest carries the wire configuration, the Runtime-resolved workspace and capability roots, Skills and MCP, the state key, the assignment and the harnessconfig.PreparedConfiguration the registry prepares once. ExecutorFactory and ViewExecutorFactory take it; the adapters' own Prepare calls and raw re-parsing of model and model_provider are gone.
  • Dispatch checks the selection again after the Environment owner resolves its installed MCP, before the factory. Without it, the installed-MCP rules R5 declared never ran in production.
  • mcode keeps its run ID in its own Turn state; Codex's always-true terminal error flags go.

Core

  • The write-only model_provider_configured marker goes.
  • A Runtime frame that fails Item projection ends the Turn with invalid_executor_result; storage failures stay event_persistence_failed.

Checks

  • Focused tests for the daemon's agent packages, agenthost, cli, dispatch, localworkspace, transport, proto, harnessconfig, and Core's execution, items, sessionpg, runtimegateway and sessions; services/core/tests/integration; -race -count=50 on the new concurrent tests; the gated agent-host suite; darwin and windows builds; make check-names check-docs check-ci.
  • Real qualification: Claude and MiniMax Code pass. Codex's Skill turn answered from the MCP tool instead of the Skill in 3 of 6 runs, with no Skills difference in the handoff; the post-merge qualification settles it.
  • Codex and Claude run contracttest.TextLifecycle. MiniMax Code does not yet: it retires its owner on every cancel, a follow-up.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

A Runtime frame that projects to no Item, such as a delta without an
item_id, failed the Turn with event_persistence_failed. items.Project now
wraps every failure in ErrInvalidObservation, and delivery reports a
journal write that fails with it as invalid_executor_result at every
flush. Storage failures stay event_persistence_failed.
Session creation added model_provider_configured to the stored
configuration whenever a provider bundle was frozen, and nothing reads
it: the execution Snapshot field was set only by test fixtures. The
marker, the field and the fixtures go, and the retry identity hashes the
configuration as requested.
Core reads only supported_agent_kinds and home_removal from a heartbeat,
and nothing reads DonePayload.Transcript. The heartbeat's ts,
active_requests and daemon_version and the transcript go. The connect
option that carries the wire version stays.
The Core-Runtime wire carries only what Core decides. Delete
AgentStateKey, LocalEnvironment's Capabilities, NetworkAccess and
AllowedDomains, the prepared configuration's RunID and Input, and every
json:"-" field. The Runtime derives the state key from the Session ID,
the Environment owner knows its installed capabilities, and Core admits
only an enabled workspace network.

ExecutorFactory and ViewExecutorFactory take agent.PrepareRequest: the
wire configuration, the model configuration the Registry prepares once,
the state key, the assignment, and the Environment's workspace and
installed Capabilities that its owner fills. Adapters no longer prepare
or re-parse the model configuration, and MiniMax Code keeps each Turn's
Run ID in its own state. Codex runs the shared text lifecycle contract.
@SaladDay
SaladDay merged commit 5460e55 into aos/cutover Oct 8, 2026
20 checks passed
@SaladDay
SaladDay deleted the aos/r6-prepare-request branch October 8, 2026 00:36
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