Skip to content

Delete the adapter Prepared path - #498

Merged
SaladDay merged 2 commits into
mainfrom
refactor/delete-adapter-prepared
Oct 7, 2026
Merged

SaladDay merged 2 commits into
mainfrom
refactor/delete-adapter-prepared

Conversation

@SaladDay

@SaladDay SaladDay commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Every Run starts through Executor.StartTurn, and dispatch serves read-only workspace preparation from the local workspace directory, so the adapter Prepared path had no production caller. This deletes it and the dead code it kept alive.

Delete the adapter Prepared path (ports the agent-outside-sandbox commit 91007ef with its shape unchanged)

  • Runtime–Harness protocol:
    • Delete agent.PreparationFactory, Prepared, PreparedCancellation, Runtime.Preparation, Runtime.WorkspaceReadPreparation, and Registry.RegisterPreparation/ResolvePreparation.
    • Delete the Codex, Claude SDK and MiniMax Code preparation factories and the Claude session's unused drain.
    • Adapters declare WorkspaceReadPreparation beside LocalEnvironment. Dispatch gates read-only execution_prepare on that declaration and readies the preparation itself.
    • harness-onboarding.md states when to declare it.
  • Codex: delete the one-shot Prepared.start/Session.run path and claimed. Their recovery, required-MCP and MCP-preflight tests now run through StartTurn.
  • Core–Runtime protocol: delete the Runtime initialization network field. Core always sent enabled, and the Runtime checked it but never enforced it. proto.Version goes to 0.13.0, so a 0.12 Runtime is rejected at connect instead of failing initialization.
  • Dispatch, read-only cleanup:
    • Delete localDirectoryPreparation, whose Close always returned nil, along with preparationState.prepared and the read-only cleanup_unconfirmed retry branch.
    • Delete the read-only handoff branches; an Executor-less preparation never gets a handoff.
    • Delete the caps.Preparation writes that RegisterKind already derives.

Settle read-only preparation release synchronously

  • A read-only release now drops ownership in the same state change. This deletes the cleanup goroutine, closePreparationResource, the shutdown close loop and the dead owns clause in the publish guard.
  • Status order is unchanged. released carries one revision fewer, because no unpublished intermediate revision exists any more.

Blind review: no blockers. The two should-fix items (the test-only codex start path, and documenting WorkspaceReadPreparation) and the nits are fixed here.

Checks:

  • gofmt; go build ./... (plus windows/darwin for ./apps/daemon/...); module-wide vet.
  • go test for agent, dispatch (-race; read-only status tests at -race -count=200), localworkspace, cli, wireconformance, internal/agentdaemon, execution and runtimegateway.
  • make check-runtime-contract check-harness-catalog check-docs, check-names.py, and the translation test.

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

Every Run starts through Executor.StartTurn, and read-only preparations
are served from the bound local workspace, so the adapter Prepared
surface and its registered preparation factories have no production
caller. Port the deletion from the agent-outside-sandbox branch with the
same shape: delete agent.Prepared, PreparedCancellation,
PreparationFactory, Runtime.Preparation, RegisterPreparation and
ResolvePreparation, the Codex, Claude SDK and MiniMax Code preparation
factories, and the Claude session's unused drain. Adapters declare
WorkspaceReadPreparation beside LocalEnvironment and dispatch readies the
local preparation directly. Delete the unenforced Runtime initialization
network field and bump the protocol version.

Delete the Codex one-shot start path (Prepared.start and Session.run),
which only tests reached, and port its behaviour tests to
Executor.StartTurn. Adapters no longer write the Preparation capability
that registration derives.

The local read-only preparation holds no resource, so delete its
always-nil Close, the preparationState.prepared closer, the read-only
cleanup_unconfirmed retry path and the handoff branches that
executor-less preparations never reach.
The read-only preparation holds no resource, so its release only drops
ownership. Drop it in the same state change instead of a cleanup
goroutine behind the busy flag, and delete closePreparationResource and
the shutdown close loop. A preparation that is still publishing its
readiness keeps ownership until that returns, as before.
@SaladDay
SaladDay merged commit 939e0c4 into main Oct 7, 2026
22 checks passed
@SaladDay
SaladDay deleted the refactor/delete-adapter-prepared branch October 7, 2026 14:17
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