Skip to content

feat(acp): pass session cwd param to acp providers#9229

Open
kalvinnchau wants to merge 3 commits into
mainfrom
kalvin/acp-session-accept-cwd-param
Open

feat(acp): pass session cwd param to acp providers#9229
kalvinnchau wants to merge 3 commits into
mainfrom
kalvin/acp-session-accept-cwd-param

Conversation

@kalvinnchau
Copy link
Copy Markdown
Collaborator

summary

implements acp cwd handling for session setup, per https://agentclientprotocol.com/protocol/session-setup

  • validates session cwd inputs are absolute paths
  • applies validation to session/new, session/load, session/fork, and _goose/update_working_dir
  • uses the session/load request cwd for provider and extension setup
  • passes session cwd through to acp subprocess providers
  • keeps non-acp providers on the default cwd-agnostic provider path
  • adds coverage to ensure loaded sessions pass the load cwd to the provider factory

noticed that even when passing the cwd it wouldn't be in the directory i sent and found that this was just using std::env::current_dir().unwrap_or_else(|_| PathBuf::from("."))

notes

acp subprocess providers must override from_env_with_working_dir to preserve session cwd, i intentionally kept the provider trait shape cwd-agnostic for non-acp providers so all non-acp providers didn't have to deal with an unused working_dir param

acp subprocess providers now share a small current-working-directory fallback helper for non-session construction paths. the provider trait default remains cwd-agnostic for non-subprocess providers

thread session working directories through acp provider construction so downstream acp sessions start from the chat cwd instead of the goose serve process cwd.

also pass the session cwd into acp extension startup and add regression coverage for provider factory cwd propagation.
validate acp cwd inputs before persisting them and reload loaded sessions after updating cwd so provider and extension setup use the request cwd.

Signed-off-by: Kalvin Chau <kalvin@block.xyz>
@kalvinnchau kalvinnchau changed the title feat: pass session cwd param to acp providers feat(acp): pass session cwd param to acp providers May 14, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f46780104e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/goose/src/acp/server.rs Outdated
validate acp cwd values with path semantics and reject missing or non-directory paths before session setup continues.

share the same validation path with working directory updates so the session entry points return invalid params synchronously.

Signed-off-by: Kalvin Chau <kalvin@block.xyz>
@kalvinnchau kalvinnchau force-pushed the kalvin/acp-session-accept-cwd-param branch from f467801 to 63584a9 Compare May 14, 2026 21:24
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