fix(fleet): sanitize slashed branch names in inbox file paths#605
Merged
Conversation
Branch names with `/` (e.g. `refactor/consolidate-ipc`) were used raw as inbox filenames, creating nested directory paths that don't exist. Add `fleet_safe_name()` to replace `/` with `-` consistently across agent flags, inbox creation, config entries, and inject writes. Also clarify the dual inbox/dropbox communication flow in the brain agent instructions — the two channels were described separately with no explanation of how they fit together.
Owner
Author
PR Review SummaryReviewed by 5 specialized agents: code-reviewer, silent-failure-hunter, pr-test-analyzer, comment-analyzer, docs-impact-agent. Critical Issues: 0Important Issues: 21. DRY violation —
2.
Suggestions
Test Coverage: Adequate, 2 improvements suggested
Strengths
Verdict: NEEDS FIXES — address the 2 important issues, then good to merge |
- Re-export fleet_safe_name() from kild-core so inject.rs calls the canonical function instead of duplicating the logic inline - Add eprintln! to update_team_config write/serialize failure paths for consistency with all other error paths in fleet.rs - Update doc comments to reflect sanitized names (<safe_name> instead of <branch>) on ensure_fleet_member, remove_fleet_member, and fleet_agent_id - Add fleet_agent_id() to fleet_safe_name() usage list in doc comment - Update CLAUDE.md fleet section to document sanitized agent flags and inbox paths - Add remove_fleet_member round-trip test with slashed branch
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
fleet_safe_name()to replace/with-in branch names used as inbox filenames —refactor/foobecomesrefactor-foo.jsoninstead of trying to createrefactor/foo.json(nested path that fails with ENOENT)--agent-name,--agent-id), inbox creation, config.json entries, inbox removal, and inject writesTest plan
cargo fmt --check— no violationscargo clippy --all -- -D warnings— no warningscargo test --all— all pass (6 new fleet tests)kild create refactor/test-inject --daemon --agent claudecreates flatrefactor-test-inject.jsoninbox filekild inject refactor/test-inject "test"delivers to both dropbox and Claude inboxkild inbox refactor/test-injectshows task with correct delivery methods