Skip to content

Conversation

@The-Best-Codes
Copy link
Collaborator

@The-Best-Codes The-Best-Codes commented Oct 25, 2025

Summary

For several months, Linux users have frequently been unable to add STDIO MCP extensions (e.g., extensions using the npx command, etc.). Obviously this is a key functionality and affects a lot of MCP servers!

The goose setup script fails on Linux with a text file busy error. I suspect this is because Hermit tries to self-update its running binary, which Linux locks, unlike macOS. The fix uses a temporary bin/hermit copy on Linux to prevent lock conflicts, redirects activation output to a log file for clean stderr, and skips these changes on macOS to preserve existing behavior.

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

Testing

I've manually tested this on Linux. I need a macOS user to test these changes. Steps to test on macOS:

  1. Checkout the PR locally or open it in a codespace. To check out the PR locally, ensure you have the GitHub CLI installed, then run gh pr checkout 5372 in the goose directory. To open the PR in a codespace, view the PR in GitHub and click Code in the top right of the PR, then Codespaces > Create codespace on best/fix-hermit-lock.
  2. Disable & enable a STDIO MCP server. You can do this in goose desktop by running just run-ui from the goose directory to start the desktop UI, then navigating to Extensions in the sidebar. Once there, find any MCP server that uses an STDIO command such as npx, disable it, and enable it again. If you don't see any MCP servers that use npx, add a new one, npx -y @angiejones/mcp-selenium for example. If you see an error, please report it to me! If not, everything should be fine. Play around with goose a bit to make sure.
  3. If you are using a codespace, you will need to test using the goose CLI.

Related Issues

Relates to #2351, #5048, #3030

Copy link
Collaborator Author

@The-Best-Codes The-Best-Codes left a comment

Choose a reason for hiding this comment

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

Ready for review!

@The-Best-Codes The-Best-Codes marked this pull request as ready for review October 25, 2025 02:51
@The-Best-Codes
Copy link
Collaborator Author

⚠️ This PR is ready for review, but do not merge it. It needs to be tested on macOS.

@IA386
Copy link

IA386 commented Oct 25, 2025

This issue also affects jbang and uvx scripts.
The implementation should only run if Hermit is not installed — inside this block:

# Check if Hermit binary exists and download if not
if [ ! -f ~/.config/goose/mcp-hermit/bin/hermit ]; then

The “text file busy” lock issue occurs only on the first start, when Hermit is not yet installed.

@The-Best-Codes
Copy link
Collaborator Author

The-Best-Codes commented Oct 25, 2025

@IA386 Yep I'm aware that is affects uvx STDIO servers as well… haven't tested with jbang but it should resolve issues with it as well.

The “text file busy” lock issue occurs only on the first start, when Hermit is not yet installed.

This is what I thought at first but not what I experienced in my testing, possibly because cleanup doesn't happen properly on failure, and it gets stuck in a “locked” state after that? Not sure.

@IA386
Copy link

IA386 commented Oct 26, 2025

At least to my understanding of the issue, there’s no cleanup process involved — the binary just dies. Your solution won’t work if someone tries to run it for the first time with a uvx-based MCP or jbang (haven’t seen any MCPs available, but I haven’t really looked either).

So in its current form, this PR doesn’t fully address the issue across different environments unless those scripts are updated as well.

Regarding the implementation — I don’t like that it will execute every time. On a successful install, subsequent runs will still copy an already replaced bin/hermit script.

If I can make a suggestion — please see my comment on #2351. I’m not completely happy with that approach either, but it only triggers once, while the Hermit environment is not yet bootstrapped.

IMHO, the best solution would be to keep the binary with its original name inside the mcp-hermit folder and leave it as is.

@rinormaloku
Copy link

Looking forward to a fix on this issue, it is making this unusable in linux.

Signed-off-by: The-Best-Codes <[email protected]>
Copy link
Collaborator Author

@The-Best-Codes The-Best-Codes left a comment

Choose a reason for hiding this comment

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

Changes are ready for review.

@angiejones angiejones requested a review from Copilot November 2, 2025 19:12
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.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@angiejones angiejones requested a review from Copilot November 2, 2025 19:20
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.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alexhancock alexhancock merged commit bb2c27b into block:main Nov 3, 2025
14 checks passed
@alexhancock
Copy link
Collaborator

Nice. Thanks for the revisions on this @The-Best-Codes

@The-Best-Codes The-Best-Codes deleted the best/fix-hermit-lock branch November 3, 2025 17:49
katzdave added a commit that referenced this pull request Nov 4, 2025
* 'main' of github.com:block/goose: (21 commits)
  Manual compaction counting fix + cli cleanup (#5480)
  chore(deps): bump prismjs and react-syntax-highlighter in /ui/desktop (#5549)
  fix: remove qwen3-coder from provider/mcp smoke tests (#5551)
  fix: do not build unsigned desktop app bundles on every PR in ci. add manual option. (#5550)
  fix: update Husky prepare script to v9 format (#5522)
  Fix 404 for responsible coding guide (#5543)
  fix hermit `text file busy` issues on linux (#5372)
  Fix image processing (#5544)
  docs: AI attribution for PRs (#5547)
  chore(tests/mcp): testing for MCP sampling (#5456)
  docs: adding HOWTOAI.md (#5533)
  added configuration content, also added signoff, fix merging issue with another commit by creating a clean branch. removed and closed commits that caused signoff issues. (#5519)
  Fixes Gemini API parse issue by converting nullable type arrays to single types in tool schemas (#5530)
  Troubleshooting diagnostics doc (#5526)
  fix link to Ollama FAQ (#5531)
  docs: remove speech-mcp (#5514)
  fix: adds ProviderRetry to openai provider (#5518)
  docs: extensions directory minor updates (#5466)
  Docs/json recipe support (#5492)
  docs: recipe buttons (#5507)
  ...
fbalicchia pushed a commit to fbalicchia/goose that referenced this pull request Nov 7, 2025
Signed-off-by: The-Best-Codes <[email protected]>
Signed-off-by: fbalicchia <[email protected]>
@rinormaloku
Copy link

Note: After upgrading I had to delete the mcp hermit directory and then it worked: rm -rf ~/.config/goose/mcp-hermit

@The-Best-Codes
Copy link
Collaborator Author

@rinormaloku Yep 💯
I was waiting for the next official release of goose so I could clarify that in the Discord. I should have clarified it here. Thanks!

@rinormaloku
Copy link

Thanks for contributing this fix @The-Best-Codes

BlairAllan pushed a commit to BlairAllan/goose that referenced this pull request Nov 29, 2025
Signed-off-by: The-Best-Codes <[email protected]>
Signed-off-by: Blair Allan <[email protected]>
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.

4 participants