Skip to content

Also do memory#6950

Merged
DOsinga merged 5 commits intomainfrom
remove-unused-working-dir
Feb 5, 2026
Merged

Also do memory#6950
DOsinga merged 5 commits intomainfrom
remove-unused-working-dir

Conversation

@DOsinga
Copy link
Collaborator

@DOsinga DOsinga commented Feb 4, 2026

Summary

Also do it in memory

Copilot AI review requested due to automatic review settings February 4, 2026 16:18
@DOsinga DOsinga requested review from zanesq and removed request for Copilot February 4, 2026 16:19
Copy link
Collaborator

@zanesq zanesq left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for doing that follow up.

Copilot AI review requested due to automatic review settings February 4, 2026 17:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_DIR environment variable fallback in extension manager
  • Refactored MemoryServer to extract working directory from request metadata instead of storing it as a field
  • Updated all memory operations to accept working_dir parameter 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")
};
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@DOsinga DOsinga added this pull request to the merge queue Feb 5, 2026
Merged via the queue into main with commit c7718a4 Feb 5, 2026
18 checks passed
@DOsinga DOsinga deleted the remove-unused-working-dir branch February 5, 2026 17:12
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>
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