Carry the bound workspace root on LocalEnvironment instead of the wire - #303
Merged
Merged
Conversation
The prompt request's work_dir field only carried the local binding's root from localworkspace.Binding.Configure to the Harness adapters; Core never set it and the binding rejected it on the wire. Move the root to LocalEnvironment as a daemon-supplied json:"-" field and delete the wire field with the guards that existed only to reject it: the Binding.Configure check, the read-only preparation term and the Core test assertions. Codex, MiniMax Code and Claude read LocalEnvironment.WorkspaceRoot for Environment execution. The adapters no longer expand ~/, reject relative paths or create directories for a wire path; the binding validates its root at construction. environment:none requests keep the working directory they had, since Core never sent work_dir. Adapter tests that set a work directory on an environment:none request moved to real LocalEnvironment requests where the cwd mattered, and the Runtime protocol and Harness onboarding docs describe where the root comes from.
A self_hosted request still carries local_environment.workspace_directory and capability source directories, so the docs say the request carries no working directory: the Runtime checks workspace_directory against its binding. Harness onboarding owns how the Harness receives the bound root. The SessionPlan.Cwd comment covers environment:none, and a test checks that Binding.Prepare rejects a mismatched WorkspaceRoot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Runtime–Harness protocol no longer passes a working directory on the wire.
PromptRequestPayload.WorkDiris deleted. The Runtime already checkslocal_environment.workspace_directoryagainst its workspace binding, and it now gives the Harness the bound directory itself throughLocalEnvironment.WorkspaceRoot(json:"-", so wire input cannot supply it).localworkspace.Binding.ConfiguresetsWorkspaceRoot.Binding.Preparerejects a request whose root differs from the binding and installs nothing.WorkspaceRoot.docs/runtime-protocol.mdandcontracts/agents-api/harness-onboarding.mddescribe the check and where the Harness gets its directory.Checks
go build ./...passes, andgo vetpasses on the daemon,agentdaemon/protoandexecution.go test ./apps/daemon/... ./internal/agentdaemon/proto/...passes: localworkspace, codex, mcode, claudesdk, dispatch and wireconformance.TestBindingPrepareRejectsOtherWorkspaceRoot. It fails when the root check is removed.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.