Skip to content

Conversation

@zanesq
Copy link
Collaborator

@zanesq zanesq commented Jan 21, 2026

Summary

The root cause was two-fold: first, the ExtensionManager::add_extension method wasn't accepting a working directory parameter, so the session's working_dir was never propagated from Agent::load_extensions_from_session. Second, for builtin extensions like developer that run in-process (not as child processes), the GOOSE_WORKING_DIR environment variable wasn't being set in the current process's environment—it was only being set for child process extensions. The fix adds a working_dir parameter through the extension loading chain and ensures GOOSE_WORKING_DIR is set in the current process when loading builtin extensions, so that when you change the working directory in the UI and extensions are reloaded, the developer extension's shell commands now correctly use the new directory.

image

closes #6610

@zanesq zanesq requested review from DOsinga and jamadeo January 21, 2026 18:08
@DOsinga
Copy link
Collaborator

DOsinga commented Jan 21, 2026

I think we should use the roots feature of MCP for the developer tool and then implement this for all extensions

@zanesq
Copy link
Collaborator Author

zanesq commented Jan 21, 2026

Agreed we should follow up with that refactor

@zanesq
Copy link
Collaborator Author

zanesq commented Jan 21, 2026

Rust test failure was pre-existing on the goose-acp crate

thread 'test_permission_persistence::allow_always' (4774) has overflowed its stack
fatal runtime error: stack overflow, aborting
error: test failed, to rerun pass `-p goose-acp --test server_test`

Caused by:
  process didn't exit successfully: `/home/runner/work/goose/goose/target/debug/deps/server_test-d0cb26eab9d9a4eb --skip 'scenario_tests::scenarios::tests'` (signal: 6, SIGABRT: process abort signal)
Error: Process completed with exit code 101.

@jamadeo
Copy link
Collaborator

jamadeo commented Jan 21, 2026

I think we should use the roots feature of MCP for the developer tool and then implement this for all extensions

Sounds so much like the right way to do it I'm not sure why we haven't already

@DOsinga
Copy link
Collaborator

DOsinga commented Jan 21, 2026

I think we should use the roots feature of MCP for the developer tool and then implement this for all extensions

Sounds so much like the right way to do it I'm not sure why we haven't already

turns out roots should restrict the MCP to the working_dir. is that what we imagine a working_dir does? maybe? /cc @alexhancock

@alexhancock
Copy link
Collaborator

Yes, I think it could make sense to group #6556 with fixing this problem

@zanesq Want to give a try at adding roots support? We would have the MCP client respond to roots/list with the goose working dir. Then have the built in servers: developer/etc request it.

I had thought I'd do this this week, so either way, let me know!

@zanesq
Copy link
Collaborator Author

zanesq commented Jan 21, 2026

Sure I can take a crack at it this week, can we merge this one for now to go with multi chat? Verified it does fix the issue in its current state.

Copy link
Collaborator

@DOsinga DOsinga left a comment

Choose a reason for hiding this comment

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

good fix, but I think it also shows the brittleness of the current plumbing

@zanesq zanesq merged commit 5bf4cf0 into main Jan 21, 2026
22 of 25 checks passed
@zanesq zanesq deleted the zane/actually-set-working-dir branch January 21, 2026 20:03
katzdave added a commit that referenced this pull request Jan 21, 2026
…ovider

* 'main' of github.com:block/goose:
  increase worker threads for ci (#6614)
  docs: todo tutorial update (#6613)
  Added goose doc map md file for goose agent to find relevant doc easily. (#6598)
  add back goose branding to home (#6617)
  fix: actually set the working dir for extensions from session (#6612)
  Multi chat (#6428)
  Lifei/fixed accumulated token count (#6587)
  Dont show MCP UI/Apps until tool is approved (#6492)
  docs: max tokens config (#6596)
  User configurable templates (#6420)
  docs: http proxy environment variables (#6594)
  feat: exclude subagent tool from code_execution filtering (#6531)
michaelneale added a commit that referenced this pull request Jan 21, 2026
* main:
  increase worker threads for ci (#6614)
  docs: todo tutorial update (#6613)
  Added goose doc map md file for goose agent to find relevant doc easily. (#6598)
  add back goose branding to home (#6617)
  fix: actually set the working dir for extensions from session (#6612)
  Multi chat (#6428)
  Lifei/fixed accumulated token count (#6587)
  Dont show MCP UI/Apps until tool is approved (#6492)
  docs: max tokens config (#6596)
  User configurable templates (#6420)
  docs: http proxy environment variables (#6594)
  feat: exclude subagent tool from code_execution filtering (#6531)
  Fix path for global agent skills (#6591)
  recipes: add mcp server (#6552)
  feat(gcp-vertex): add model list with org policy filtering (#6393)
  chore: encourage extension searching (#6582)
  blog: mobile apps consolidation and roadmap (#6580)
  chore: remove unused dependencies in cargo.toml (#6561)
  resolved all the extensions to load in cli (#6464)
michaelneale added a commit that referenced this pull request Jan 21, 2026
* main:
  increase worker threads for ci (#6614)
  docs: todo tutorial update (#6613)
  Added goose doc map md file for goose agent to find relevant doc easily. (#6598)
  add back goose branding to home (#6617)
  fix: actually set the working dir for extensions from session (#6612)
  Multi chat (#6428)
  Lifei/fixed accumulated token count (#6587)
  Dont show MCP UI/Apps until tool is approved (#6492)
michaelneale added a commit that referenced this pull request Jan 21, 2026
* main:
  increase worker threads for ci (#6614)
  docs: todo tutorial update (#6613)
  Added goose doc map md file for goose agent to find relevant doc easily. (#6598)
  add back goose branding to home (#6617)
  fix: actually set the working dir for extensions from session (#6612)
  Multi chat (#6428)
  Lifei/fixed accumulated token count (#6587)
  Dont show MCP UI/Apps until tool is approved (#6492)
@zanesq zanesq restored the zane/actually-set-working-dir branch January 22, 2026 00:37
lifeizhou-ap added a commit that referenced this pull request Jan 22, 2026
* main: (41 commits)
  chore: tweak release docs (#6571)
  fix(goose): propagate session_id across providers and MCP (#6584)
  increase worker threads for ci (#6614)
  docs: todo tutorial update (#6613)
  Added goose doc map md file for goose agent to find relevant doc easily. (#6598)
  add back goose branding to home (#6617)
  fix: actually set the working dir for extensions from session (#6612)
  Multi chat (#6428)
  Lifei/fixed accumulated token count (#6587)
  Dont show MCP UI/Apps until tool is approved (#6492)
  docs: max tokens config (#6596)
  User configurable templates (#6420)
  docs: http proxy environment variables (#6594)
  feat: exclude subagent tool from code_execution filtering (#6531)
  Fix path for global agent skills (#6591)
  recipes: add mcp server (#6552)
  feat(gcp-vertex): add model list with org policy filtering (#6393)
  chore: encourage extension searching (#6582)
  blog: mobile apps consolidation and roadmap (#6580)
  chore: remove unused dependencies in cargo.toml (#6561)
  ...
wpfleger96 added a commit that referenced this pull request Jan 22, 2026
* main: (68 commits)
  fix(docs): use dynamic import for globby ESM module (#6636)
  chore: trigger CI
  Document tab completion (#6635)
  Install goose-mcp crate dependencies (#6632)
  feat(goose): standardize agent-session-id for session correlation (#6626)
  chore: tweak release docs (#6571)
  fix(goose): propagate session_id across providers and MCP (#6584)
  increase worker threads for ci (#6614)
  docs: todo tutorial update (#6613)
  Added goose doc map md file for goose agent to find relevant doc easily. (#6598)
  add back goose branding to home (#6617)
  fix: actually set the working dir for extensions from session (#6612)
  Multi chat (#6428)
  Lifei/fixed accumulated token count (#6587)
  Dont show MCP UI/Apps until tool is approved (#6492)
  docs: max tokens config (#6596)
  User configurable templates (#6420)
  docs: http proxy environment variables (#6594)
  feat: exclude subagent tool from code_execution filtering (#6531)
  Fix path for global agent skills (#6591)
  ...
wpfleger96 added a commit that referenced this pull request Jan 22, 2026
* main: (68 commits)
  fix(docs): use dynamic import for globby ESM module (#6636)
  chore: trigger CI
  Document tab completion (#6635)
  Install goose-mcp crate dependencies (#6632)
  feat(goose): standardize agent-session-id for session correlation (#6626)
  chore: tweak release docs (#6571)
  fix(goose): propagate session_id across providers and MCP (#6584)
  increase worker threads for ci (#6614)
  docs: todo tutorial update (#6613)
  Added goose doc map md file for goose agent to find relevant doc easily. (#6598)
  add back goose branding to home (#6617)
  fix: actually set the working dir for extensions from session (#6612)
  Multi chat (#6428)
  Lifei/fixed accumulated token count (#6587)
  Dont show MCP UI/Apps until tool is approved (#6492)
  docs: max tokens config (#6596)
  User configurable templates (#6420)
  docs: http proxy environment variables (#6594)
  feat: exclude subagent tool from code_execution filtering (#6531)
  Fix path for global agent skills (#6591)
  ...
wpfleger96 added a commit that referenced this pull request Jan 22, 2026
* main: (68 commits)
  fix(docs): use dynamic import for globby ESM module (#6636)
  chore: trigger CI
  Document tab completion (#6635)
  Install goose-mcp crate dependencies (#6632)
  feat(goose): standardize agent-session-id for session correlation (#6626)
  chore: tweak release docs (#6571)
  fix(goose): propagate session_id across providers and MCP (#6584)
  increase worker threads for ci (#6614)
  docs: todo tutorial update (#6613)
  Added goose doc map md file for goose agent to find relevant doc easily. (#6598)
  add back goose branding to home (#6617)
  fix: actually set the working dir for extensions from session (#6612)
  Multi chat (#6428)
  Lifei/fixed accumulated token count (#6587)
  Dont show MCP UI/Apps until tool is approved (#6492)
  docs: max tokens config (#6596)
  User configurable templates (#6420)
  docs: http proxy environment variables (#6594)
  feat: exclude subagent tool from code_execution filtering (#6531)
  Fix path for global agent skills (#6591)
  ...
fbalicchia pushed a commit to fbalicchia/goose that referenced this pull request Jan 23, 2026
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.

Bug: Working directory not passed to ExtensionManager when extensions are loaded

5 participants