fix: spawn lineage, extract tests, remove kill instructions - #16
Merged
Conversation
Fail closed when a spawn omits parent lineage so delegated workers cannot silently become root L1 workers. This keeps depth labels, wake routing, and completion deferral aligned with the real worker tree while documenting the new v0.0.7 contract. Made-with: Cursor
- Stop normalizing `openclaw` to empty string; preserve in spawned_by - Root spawns (L0→L1) now correctly produce depth=1 instead of depth=0 - resolve_spawn_lineage returns parent.depth+1 for known parents, depth=1 for L0 markers (openclaw, self, legacy root) - Add `--spawned-by self` for L0 cc/cx/cu orchestrators: auto-detects or generates L0 pane name from tmux window title - orca list now shows L0 orchestrator headers (e.g. |-🐋 | L0 openclaw) - Update validate_spawn_context to allow L0 markers as spawned_by - Update SKILL.md with L0 cc/cx/cu instructions (self marker) - Fix 5 broken tests, add 13 new tests (606 total, all passing) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace normalize_spawned_by/resolve_self_l0_name with ensure_l0_orchestrator that auto-registers L0 entries (openclaw or cc/cx/cu) in state at depth=0 - Workers spawned by L0 now correctly get depth=1 (🐳 L1) via parent lookup - print_tree shows L0 orchestrator entries as group headers with backend info - cmd_kill protects virtual openclaw L0 entries from being killed - cmd_killall/cmd_gc skip L0 orchestrator entries (bookkeeping, not workers) - Validate spawn context before L0 registration to avoid side effects on error - Remove L0 window rename from spawn.rs (now handled by ensure_l0_orchestrator) - Update integration tests to use depth=1/spawned_by=openclaw for seeded workers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move inline `#[cfg(test)] mod tests` blocks from all 11 source modules into dedicated `tests.rs` companion files using the directory module pattern (e.g. `src/cli.rs` -> `src/cli/mod.rs` + `src/cli/tests.rs`). This reduces production source file sizes by ~60% (from 11,060 to 4,561 lines across src/) while keeping all 617 tests passing with full access to private items via `use super::*`. Also updates `include_str!` paths in cli/mod.rs to account for the extra directory nesting. Made-with: Cursor
🧪 Coverage Report
📄 Coverage by file
|
Agents receiving wake/stuck/warn notifications were seeing "orca kill <name>" as a suggested action, which led to agents killing workers (including orchestrators) without human approval. This caused the ivy orchestrator to get killed during testing. - Remove "orca kill" lines from wake_message, stuck_message, warn_message, and routing_block in wake/mod.rs - Remove "orca killall --mine" cleanup instructions from the REPORT_INSTRUCTIONS prompt injected into spawned workers - Update SKILL.md to explicitly forbid agents from killing/gc-ing workers without human approval - Update wake tests to assert kill instructions are absent Made-with: Cursor
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Spawn lineage (v0.0.7)
--spawned-byon everyorca spawncall; fail closed when lineage is missing--spawned-by self)orca listshows L0 orchestrator headers with backend infoExtract unit tests
#[cfg(test)] mod testsblocks from all 11 source modules into dedicatedtests.rscompanion files (src/foo.rs->src/foo/mod.rs+src/foo/tests.rs)Remove kill instructions from agent notifications
Test plan
cargo fmt --checkpassescargo clippy -- -D warningspassescargo nextest run-- 617 tests pass, 0 failures