Skip to content

Conversation

@linw1995
Copy link
Owner

Closes #124

Summary

This PR implements the "RunCombo: move execution into coco combo run" enhancement by migrating combo execution from the run_combo tool to a dedicated CLI command coco combo run with session socket integration.

Key Changes

1. New CLI Command (src/cmd/combo.rs)

  • Added coco combo run <name> [args...] as the canonical entrypoint for combo execution
  • Supports both standalone mode and inline mode when COCO_SESSION_SOCK is present
  • Streams events and returns JSON summary

2. Session Socket Protocol Extensions (src/combo/session.rs)

  • Extended session socket protocol to support combo run requests
  • Added event streaming for real-time UI updates
  • Implemented result aggregation and JSON output

3. TUI Bridge Components (crates/coco-tui/src/)

  • combo_run_bridge.rs: Manages communication between CLI and TUI session
  • combo_run_server.rs: Session socket server handling combo run events
  • Updated chat.rs and messages/combo.rs: Enhanced to display streaming combo events

4. Tool Integration

  • Modified bash tool to inject COCO_SESSION_SOCK when invoking coco combo run
  • Agent now uses bash tool to execute combos via CLI instead of run_combo tool
  • Preserved transcript linking for combo runs executed via bash tool

5. Permission & Safety

  • Added permission handling for combo execution via Bash tool
  • Ensures TTY or session socket availability before execution
  • Proper error handling and user feedback

Behavior

  • With running TUI: coco combo run demo a b streams events to the TUI and returns JSON summary
  • Without TUI: Command starts the TUI and runs the combo
  • Agent usage: Agent invokes coco combo run via bash tool, with proper environment injection

@codecov-commenter
Copy link

codecov-commenter commented Jan 28, 2026

Codecov Report

❌ Patch coverage is 9.56873% with 1342 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.04%. Comparing base (a46f02c) to head (68e25cd).
⚠️ Report is 8 commits behind head on dev.

Files with missing lines Patch % Lines
crates/coco-tui/src/components/chat.rs 0.00% 591 Missing ⚠️
crates/coco-tui/src/components/messages/combo.rs 6.78% 206 Missing ⚠️
crates/coco-tui/src/combo_run_server.rs 0.00% 141 Missing ⚠️
src/cmd/combo.rs 0.00% 139 Missing ⚠️
src/tools/run_combo.rs 0.90% 110 Missing ⚠️
crates/coco-tui/src/combo_run_bridge.rs 0.00% 39 Missing ⚠️
crates/coco-tui/src/main.rs 35.18% 35 Missing ⚠️
src/agent.rs 0.00% 21 Missing ⚠️
src/combo/session.rs 85.85% 14 Missing ⚠️
crates/coco-tui/src/components/messages.rs 0.00% 10 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #150      +/-   ##
==========================================
- Coverage   50.22%   47.04%   -3.19%     
==========================================
  Files          93       98       +5     
  Lines       25033    27348    +2315     
==========================================
+ Hits        12574    12865     +291     
- Misses      12459    14483    +2024     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Implement Unix socket server for combo run session communication.
Add bridge for managing active connections and forwarding combo events
and results to external processes in real-time.

Resolves #146
Implement `coco combo run` command that executes combos via session socket.
Add support for spawning TUI process when no active session exists.
Integrate ignore_workspace_scripts flag across CLI and TUI layers.
Ensure COCO_TUI_BIN environment variable is set for proper subprocess handling.

Resolves #147
Remove RunComboTool and convert combo execution to a built-in agent feature.
- Add execute_combo_with_output method to Agent for direct combo execution
- Update TUI to use task_combo_execute instead of tool-based execution
- Remove run_combo from builtin tools list in agent.toml
- Simplify combo execution by eliminating tool abstraction layer

Resolves #148
@linw1995 linw1995 force-pushed the feature/move-combo-run-into-cli branch from 12cc4d5 to 68e25cd Compare January 28, 2026 06:15
@linw1995 linw1995 merged commit 48891c2 into dev Jan 28, 2026
3 checks passed
@linw1995 linw1995 added the enhancement New feature or request label Jan 28, 2026
@linw1995 linw1995 deleted the feature/move-combo-run-into-cli branch January 28, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RunCombo: move execution into coco combo run and bridge events

3 participants