Merged
Conversation
zanesq
approved these changes
Feb 4, 2026
Collaborator
zanesq
left a comment
There was a problem hiding this comment.
LGTM! Thanks for doing that follow up.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors how working directories are passed to MCP servers, replacing environment variable-based communication with request metadata.
Changes:
- Removed
GOOSE_WORKING_DIRenvironment variable fallback in extension manager - Refactored
MemoryServerto extract working directory from request metadata instead of storing it as a field - Updated all memory operations to accept
working_dirparameter dynamically per request
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/goose/src/agents/extension_manager.rs | Simplified working directory handling by removing GOOSE_WORKING_DIR env var fallback logic |
| crates/goose-mcp/src/memory/mod.rs | Refactored to extract working_dir from request metadata, removed local_memory_dir field, updated all methods and tests |
Comment on lines
251
to
259
| let base_dir = if is_global { | ||
| &self.global_memory_dir | ||
| self.global_memory_dir.clone() | ||
| } else { | ||
| &self.local_memory_dir | ||
| let local_base = working_dir | ||
| .cloned() | ||
| .or_else(|| std::env::current_dir().ok()) | ||
| .unwrap_or_else(|| PathBuf::from(".")); | ||
| local_base.join(".goose").join("memory") | ||
| }; |
There was a problem hiding this comment.
The logic for computing the local memory base directory is duplicated in three methods: get_memory_file, retrieve_all, and clear_all_global_or_local_memories. Consider extracting this into a helper method to reduce duplication and improve maintainability.
kuccello
pushed a commit
to kuccello/goose
that referenced
this pull request
Feb 7, 2026
Co-authored-by: Douwe Osinga <douwe@squareup.com>
Tyler-Hardin
pushed a commit
to Tyler-Hardin/goose
that referenced
this pull request
Feb 11, 2026
Co-authored-by: Douwe Osinga <douwe@squareup.com>
Tyler-Hardin
pushed a commit
to Tyler-Hardin/goose
that referenced
this pull request
Feb 11, 2026
Co-authored-by: Douwe Osinga <douwe@squareup.com>
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
Also do it in memory