Overview
Enable combo scripts to invoke coco combo run commands, allowing nested combo execution for modular and reusable automation workflows.
Current State
The codebase currently blocks combo run requests within combo sessions:
src/combo/starter.rs:1231-1237 rejects ClientMessage::ComboRun with "combo run is not allowed in combo session"
- No recursion depth limit exists
- Each combo creates an independent SessionEnv and socket
Proposed Solution
1. Add Recursion Protection
- Introduce
COCO_COMBO_DEPTH environment variable
- Set maximum depth limit (e.g.,
MAX_COMBO_DEPTH = 5)
- Increment depth on nested calls
2. Remove Blocking Logic
- Modify
src/combo/starter.rs to allow ComboRun messages with depth validation
- Return clear error when depth limit exceeded
3. Environment Propagation
- Ensure nested combos inherit appropriate context
- Handle socket path routing for multi-level sessions
Acceptance Criteria
Implementation Notes
Key files to modify:
src/combo/starter.rs - Remove blocking, add depth check
src/combo/session_env.rs - Add depth env var
src/tools/run_combo.rs - Propagate depth context
src/cmd/combo.rs - CLI entry handling
Technical considerations:
- Each nested combo creates independent SessionEnv (existing behavior)
- Child processes inherit
COCO_SESSION_SOCK (existing behavior)
- Event routing complexity increases with nesting levels
Overview
Enable combo scripts to invoke
coco combo runcommands, allowing nested combo execution for modular and reusable automation workflows.Current State
The codebase currently blocks combo run requests within combo sessions:
src/combo/starter.rs:1231-1237rejectsClientMessage::ComboRunwith "combo run is not allowed in combo session"Proposed Solution
1. Add Recursion Protection
COCO_COMBO_DEPTHenvironment variableMAX_COMBO_DEPTH = 5)2. Remove Blocking Logic
src/combo/starter.rsto allowComboRunmessages with depth validation3. Environment Propagation
Acceptance Criteria
coco combo run <name>commandsCOCO_COMBO_DEPTHenv varImplementation Notes
Key files to modify:
src/combo/starter.rs- Remove blocking, add depth checksrc/combo/session_env.rs- Add depth env varsrc/tools/run_combo.rs- Propagate depth contextsrc/cmd/combo.rs- CLI entry handlingTechnical considerations:
COCO_SESSION_SOCK(existing behavior)