You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
f.agent options.cwd is accepted by the SDK and refused by the kernel (invalid_spec: unknown field "cwd") #489
packages/sdk/src/authored-worker-step.ts validates options.cwd (f.agent options.cwd must be a string when set) and lowers it into the step spec (...(options.cwd === undefined ? {} : { cwd: options.cwd })), but the kernel refuses the field:
FAILED [protocol_error] relayflowd could not complete the run request:
invalid_spec: unknown field "cwd" at steps[0] — refusing to guess (fail closed)
Reproduced on relayflows 2.0.21 with flows run --local-agent and a two-step flow whose first f.agent sets cwd. flows check passes — nothing catches it before the run.
Either the kernel should accept cwd on agent/llm steps (run the CLI in that directory, still inside the run's tree) or the SDK should refuse it at authoring time with a named refusal and flows check should catch it. Accepting-then-refusing at dispatch is the worst of the three. If cwd is meant to be expressed another way (workspace surfaces?), say so in docs/SURFACE.md where AgentOptions is documented.
Found while writing a multi-repo flow that drives agents in two checkouts.
Independent corroboration from the Relayflows v2 Field Report (2026-09-18, Julian Fann), building a GitLab-sourced factory on CLI 2.0.19. They rate this the most serious of their four blockers.
Three packages at the same version number disagree:
Package
Version
Declares cwd?
@relayflows/surface
2.0.19
yes — AgentOptions.cwd?: string
@relayflows/sdk
2.0.19
yes — AgentStepSpec.cwd?: string
@relayflows/runtime-darwin-arm64 (relayflowd)
2.0.19
no
Both .d.ts files even carry the same doc comment: "Working directory for the CLI subprocess; defaults to the flow-runner's cwd."tsc --strict accepted it and flows check returned exit 0.
The knock-on cost is worth recording, because it is not just an error message: cwd was how they isolated each agent to a per-issue worktree. Losing it meant the agent starts in the outer checkout, so a runtime guarantee had to be replaced with a prompt instruction plus a git status --porcelain snapshot taken on both sides of the agent step. That works, but a prompt is not a sandbox.
Filed alongside this, from the same report: the class-level gap that let it through (#502) and a startup compatibility assertion that would have turned this into a clear refusal before any work happened (#505).
Activity
khaliqgant commentedon Sep 20, 2026
Independent corroboration from the Relayflows v2 Field Report (2026-09-18, Julian Fann), building a GitLab-sourced factory on CLI 2.0.19. They rate this the most serious of their four blockers.
Three packages at the same version number disagree:
cwd?@relayflows/surfaceAgentOptions.cwd?: string@relayflows/sdkAgentStepSpec.cwd?: string@relayflows/runtime-darwin-arm64(relayflowd)Both
.d.tsfiles even carry the same doc comment: "Working directory for the CLI subprocess; defaults to the flow-runner's cwd."tsc --strictaccepted it andflows checkreturned exit 0.The knock-on cost is worth recording, because it is not just an error message:
cwdwas how they isolated each agent to a per-issue worktree. Losing it meant the agent starts in the outer checkout, so a runtime guarantee had to be replaced with a prompt instruction plus agit status --porcelainsnapshot taken on both sides of the agent step. That works, but a prompt is not a sandbox.Filed alongside this, from the same report: the class-level gap that let it through (#502) and a startup compatibility assertion that would have turned this into a clear refusal before any work happened (#505).
flows check never talks to the daemon, so it structurally cannot catc…