Skip to content

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

Merged
michaelneale merged 3 commits into
mainfrom
kalvin/acp-session-accept-cwd-param
May 18, 2026
Merged

feat(acp): pass session cwd param to acp providers#9229
michaelneale merged 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

@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

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

Copy link
Copy Markdown

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

Signed-off-by: Matt Toohey <contact@matttoohey.com>
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>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
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>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
@matt2e
matt2e force-pushed the kalvin/acp-session-accept-cwd-param branch from 63584a9 to 64a8f46 Compare May 18, 2026 02:18

@michaelneale michaelneale left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

looks good, keeps the way it used to work otherwise, and seems to be the way the spec goes. nice.

@michaelneale
michaelneale added this pull request to the merge queue May 18, 2026
Merged via the queue into main with commit bf54314 May 18, 2026
30 of 31 checks passed
@michaelneale
michaelneale deleted the kalvin/acp-session-accept-cwd-param branch May 18, 2026 06:01
michaelneale added a commit that referenced this pull request May 19, 2026
* origin/main: (160 commits)
  Add Linux musl CLI builds (#9240)
  feat(acp): paginate session list (#9199)
  docs: reorganize (#9310)
  Structured per-provider config block, non-destructive provider switching (#8977)
  feat(cli): add `goose review` local code review command (#9114)
  feat(tui): diff viewer (#9260)
  fix(otel): emit trace_output as span attribute instead of event (#9255)
  docs: add guide for connecting goose Desktop to a remote goosed server (#9275)
  fix(config): check file fallback when keyring has no entry (#9279)
  fix(desktop): ScheduleModal error message styling (#9278)
  fix(ui): align sidebar hamburger in macOS fullscreen (#9257)
  Add documentation for new provider SaladCloud AI Gateway (#9253)
  fix: use current_exe() instead of PATH lookup when spawning goose (#9236)
  fix(extension_manager): set TCP_USER_TIMEOUT on streamable HTTP clients (#9207)
  fix: activate custom provider after adding via configure (#9213)
  Flush OTLP traces reliably on exit with configurable timeout (#9228)
  fix: reduce excessive MISSING_TRANSLATION warnings for fallback locales (#9294)
  feat(acp): pass session cwd param to acp providers (#9229)
  fix(desktop): eliminate cross-window deep link contamination (#9273)
  fix: improve Telegram gateway error reporting and connection reliability (#9223)
  ...

Signed-off-by: Michael Neale <michael.neale@gmail.com>

# Conflicts:
#	crates/goose/src/agents/agent.rs
#	crates/goose/tests/agent.rs
shafqatevo pushed a commit to shafqatevo/goose that referenced this pull request Aug 7, 2026
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
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.

2 participants