feat(acp): pass session cwd param to acp providers#9229
Open
kalvinnchau wants to merge 3 commits into
Open
Conversation
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>
There was a problem hiding this comment.
💡 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".
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>
f467801 to
63584a9
Compare
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.
summary
implements acp cwd handling for session setup, per https://agentclientprotocol.com/protocol/session-setup
noticed that even when passing the
cwdit wouldn't be in the directory i sent and found that this was just usingstd::env::current_dir().unwrap_or_else(|_| PathBuf::from("."))notes
acp subprocess providers must override
from_env_with_working_dirto 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 unusedworking_dirparamacp 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