Skip to content

claude-agent-sdk: forward the resolved working_dir to ClaudeAgentOptions.cwd #348

Description

Summary

ClaudeAgentSdkProvider.CAPABILITIES declares working_dir=False, so conductor validate rejects any workflow setting agent.working_dir or runtime.working_dir against this provider.

Until #335 the stated reason was that MCP servers were rejected at the factory, so there was "nothing to scope by directory". That premise is gone — the provider now spawns MCP servers — and the comment was rewritten in #346 to give the real reason: the provider never forwards the engine-resolved working directory to ClaudeAgentOptions.cwd. The capability is still accurate, but it is now a plain gap rather than a consequence of another one.

Why it's worth closing

ClaudeAgentOptions has a cwd field (types.py:1699), so the plumbing is straightforward. Two things depend on it:

Today both silently use whatever directory the Conductor process happens to be in.

Scope

  • Forward the resolved working_dir to ClaudeAgentOptions.cwd in execute().
  • Flip CAPABILITIES.working_dir to True and update the comment at providers/claude_agent_sdk.py.
  • Update the carve-out row in docs/providers/experimental.md and the parity notes in AGENTS.md.
  • Mirror the existing working-dir tests for this provider (see feat(working-dir): working_dir for LLM agents and their MCP servers #297 for the pattern).

Worth confirming how cwd interacts with add_dirs and whether a non-existent directory should fail before the SDK call, matching the engine's existing behavior of raising an execution error for a missing target directory (docs/mcp-tools.md:259).

Related

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions