Skip to content

Conversation

@jamadeo
Copy link
Collaborator

@jamadeo jamadeo commented Aug 12, 2025

The new rmcp child processes were getting the signals forwarded to them. Avoid this by giving them their own process group. They are still cleaned up when the parent exits.

This also fixes the fact that we had three different ways of spawning a child process for an extension (stdio, builtin, and inline python)

fixes: #4026

@jamadeo jamadeo requested a review from DOsinga August 12, 2025 20:16
mut command: Command,
timeout: &Option<u64>,
) -> ExtensionResult<McpClient> {
command.process_group(0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought you said we'd give them their own process group, isn't this the same process group? also, does this work on Windows?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

0 sets it to its own group (uses the pid)

Re: Windows: eh, I think no. I don't actually even know what the current behavior here is on windows. I don't have windows machine to test. Any ideas there?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah there is no process_group on windows it seems.

.spawn()?;
let mut stderr = stderr
.take()
.expect("should have a stderr handle because it was requested");
Copy link
Collaborator

Choose a reason for hiding this comment

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

this shouldn't happen of course, but I'd still rather do .ok_or or something so we don't panic

@michaelneale
Copy link
Collaborator

what behavior change would we expect here - control-C hard exits the session now (new as of this month) not sure if that is meant to change as well?

@michaelneale
Copy link
Collaborator

yes this fixes: #4026

Copy link
Collaborator

@michaelneale michaelneale left a comment

Choose a reason for hiding this comment

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

this is much improved - as for windows, that process group is a no-op so it is no worse.

* main:
  docs: mcp-ui support (#4049)
  fix: delete dialog layout (#4037)
  ci: fix markdown file pattern to skip builds for all .md files (#4061)
  docs: add window title (#4059)
  blog: cleaning up some posts (#4050)
  fix: this should be a debug message not a warn (#4024)
  Better provider logging (#4052)
  feat: ToolError migration to ErrorData (#4051)
  docs: rename sessions (#4053)
  Add mcp automated testing blog (#4004)
@michaelneale michaelneale self-assigned this Aug 13, 2025
@jamadeo jamadeo merged commit 4f3038b into main Aug 13, 2025
11 checks passed
@jamadeo jamadeo deleted the jackamadeo/fix-ctrl-c branch August 13, 2025 14:30
jamadeo added a commit that referenced this pull request Aug 13, 2025
Co-authored-by: Michael Neale <michael.neale@gmail.com>
katzdave added a commit that referenced this pull request Aug 13, 2025
* 'main' of github.com:block/goose:
  fix(build): feed electronforge the icon explicitly for linux (#4045)
  Docs: Troubleshooting tip - Nodejs path on windows (#4065)
  fix: flag out uncompilable bit in windows (#4068)
  ci: fix docs-only filter to properly skip tests for documentation changes (#4066)
  fix: ctrl-C interruption in the CLI (#4057)
zanesq added a commit that referenced this pull request Aug 13, 2025
* 'main' of github.com:block/goose: (120 commits)
  Docs: Troubleshooting tip - Nodejs path on windows (#4065)
  fix: flag out uncompilable bit in windows (#4068)
  ci: fix docs-only filter to properly skip tests for documentation changes (#4066)
  fix: ctrl-C interruption in the CLI (#4057)
  docs: mcp-ui support (#4049)
  fix: delete dialog layout (#4037)
  ci: fix markdown file pattern to skip builds for all .md files (#4061)
  docs: add window title (#4059)
  blog: cleaning up some posts (#4050)
  fix: this should be a debug message not a warn (#4024)
  Better provider logging (#4052)
  feat: ToolError migration to ErrorData (#4051)
  docs: rename sessions (#4053)
  Add mcp automated testing blog (#4004)
  MCP session replay integration test (#3939)
  Docs: Cost tracking in CLI (#4043)
  sanitize message content on deserialization (#3966)
  Move summarize button inside of context view (#4015)
  blog: post on lead/worker model (#3994)
  Actually send cancellation to MCP servers (#3865)
  ...
jsibbison-square added a commit that referenced this pull request Aug 14, 2025
…ol-visibility

* origin/main: (43 commits)
  docs: Blog - How I Used Goose to Rebuild My Website (#4076)
  docs: custom context file names (#4077)
  Blog: How Pulse MCP Used Goose to Automate Their Newsletter (#4075)
  Load recipe deeplinks in single window when app is closed (#4048)
  docs: make accurate the comments with links to unsigned builds of the app (#4070)
  cleanup memory in chat (#4073)
  CLI: improve model selection ux (#4071)
  speed up loading extensions by loading in parallel (#4054)
  fix(build): feed electronforge the icon explicitly for linux (#4045)
  Docs: Troubleshooting tip - Nodejs path on windows (#4065)
  fix: flag out uncompilable bit in windows (#4068)
  ci: fix docs-only filter to properly skip tests for documentation changes (#4066)
  fix: ctrl-C interruption in the CLI (#4057)
  docs: mcp-ui support (#4049)
  fix: delete dialog layout (#4037)
  ci: fix markdown file pattern to skip builds for all .md files (#4061)
  docs: add window title (#4059)
  blog: cleaning up some posts (#4050)
  fix: this should be a debug message not a warn (#4024)
  Better provider logging (#4052)
  ...
ayax79 pushed a commit to ayax79/goose that referenced this pull request Aug 21, 2025
Co-authored-by: Michael Neale <michael.neale@gmail.com>
Signed-off-by: Jack Wright <jack.wright@nike.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.

ctrl-c kills goose instead of stops the current operation

4 participants