Skip to content

Spence/active tool#6899

Draft
spencrmartin wants to merge 2 commits intomainfrom
spence/active-tool
Draft

Spence/active tool#6899
spencrmartin wants to merge 2 commits intomainfrom
spence/active-tool

Conversation

@spencrmartin
Copy link
Collaborator

@spencrmartin spencrmartin commented Feb 2, 2026

Summary

Type of Change

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

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

Related Issues

Relates to #ISSUE_ID
Discussion: LINK (if any)

Screen.Recording.2026-02-02.at.11.53.39.AM.mov

- Add isActiveToolState check for Streaming and Thinking states
- Allow direct message submission when Goose is actively working
- Backend handles message queuing - user can chat while Goose works
- Add debug logging to track chat state during submission
- Interruption keywords still trigger stop and queue the message

This enables users to send messages even when:
- Goose is streaming a response
- Goose is thinking/processing
- A tool call is running (including backgrounded commands with &)

The key insight: we don't need to detect specific 'run' commands.
Any message sent during active states goes directly to the backend,
which already has message queuing capabilities.
GOOSE-2, GOOSE-3, GOOSE-4: Backend infrastructure for background processes

## What's New

### Shell Tool Enhancement (GOOSE-3)
- Added `background: Option<bool>` parameter to ShellParams
- When `background: true`, command spawns and returns immediately with process ID
- Agent loop can continue processing new messages while process runs

### Background Process Tracking (GOOSE-2)
- New `BackgroundProcess` struct with id, command, pid, status, output buffer
- `BackgroundProcessStatus` enum: Running, Completed, Failed, Cancelled
- Ring buffer (1000 lines) captures stdout/stderr for later retrieval
- Real-time output streaming via notify_logging_message

### Process Management Tools (GOOSE-4)
- `list_background_processes`: Shows all tracked processes with status/runtime
- `get_background_process_output`: Retrieves last N lines from output buffer
- `stop_background_process`: Sends SIGTERM to terminate running process

## Why This Matters
This solves the core UX issue where long-running commands (npm run dev, etc.)
block the chat. Now Goose can:
1. Start a dev server with `background: true`
2. Return immediately with process ID
3. Continue processing new user messages
4. User can check/stop the process later

## Files Changed
- crates/goose-mcp/Cargo.toml (added uuid dependency)
- crates/goose-mcp/src/developer/rmcp_developer.rs (main implementation)

## Testing
All 182 existing tests pass. Background process functionality ready for
integration testing with the desktop app.
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.

1 participant