feat: add task tool for spawning subagents#80
Conversation
- Refactor clemini from pure binary to library+binary architecture - Add src/lib.rs exposing AgentEvent, run_interaction, CleminiToolService - Move logging infrastructure to src/logging.rs with OutputSink trait - Add tests/confirmation_tests.rs with 4 live API tests: - test_destructive_command_requests_confirmation - test_confirmation_approval_executes_command - test_safe_command_no_confirmation - test_confirmation_response_is_semantic - Add semantic validation using Gemini structured output - Add serial_test dependency for global state tests Run live tests with: cargo test --test confirmation_tests -- --include-ignored Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Drop MutexGuard before awaiting child.kill() in bash tests - Remove unnecessary let binding in init_test_logging - Collapse nested if statements using let chain Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add comment explaining unsafe env var usage in Rust 2024 edition - Expand re-export pattern comment for clarity - Improve semantic validator comment and use eprintln for warnings - Add Makefile comment explaining separate test invocations Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Change tool executing prefix from 🔧 to ┌─ to create visual bracket with tool result line (└─), making tool call output more structured: ┌─ bash command="ls" └─ bash 0.01s ~20 tok Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Change tool executing format from: ┌─ (dimmed) name (cyan) args (dimmed) to: ┌─ name (cyan) args This makes the opening bracket match the closing bracket (└─) and improves readability of tool arguments. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix ordering issues where tools called log_event() directly, causing race conditions with async events. Tools now emit AgentEvent::ToolOutput events via channels, ensuring all output flows through the event system in correct order. Changes: - Add ToolOutput variant to AgentEvent - Add on_tool_output() to EventHandler trait - All 11 tools receive events_tx and emit via emit() helper - Add graceful RwLock poisoning recovery - Add 3 integration test files with semantic validation - Wire integration tests into CI with GEMINI_API_KEY - Add make test-all target for running full test suite Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add .gradle/, bin/, node_modules/, build/, .class files, and package-lock.json patterns for benchmark exercises. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Allow dead_code on EXTENDED_TIMEOUT constant - Remove unnecessary let binding in create_test_tool_service Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add --reset flag to restore exercises to clean state before running - Warn users when exercises have uncommitted changes from previous runs - Add -y/--yes flag to skip confirmation prompts - Show list of modified files when dirty state detected Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The test_file_not_found_helpful_response test can take longer than 60s because the model may try multiple approaches (glob, read) before giving up and suggesting alternatives. Use EXTENDED_TIMEOUT (120s) to avoid flaky CI failures. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add a task tool that spawns clemini subprocesses to handle delegated work. Supports foreground (wait for result) and background (fire-and- forget) modes. Key changes: - New src/tools/task.rs with TaskTool implementation - Make NEXT_TASK_ID pub(crate) for reuse across tools - Register TaskTool in CleminiToolService Design decisions: - Reuses BACKGROUND_TASKS registry so kill_shell works for both - Configurable invocation: tries current_exe(), falls back to cargo run - Fire-and-forget MVP; output capture tracked in #79 Closes #78 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code ReviewSummaryThis PR adds a Issues FoundCriticalNone Important
Suggestions
VerdictREQUEST_CHANGES - The task tool implementation is solid overall, but there are a couple of important issues around subagent behavior (output capture semantics, path restrictions) that should be clarified either in code or documentation before merging. Automated review by Claude Code |
- Add tracing::warn when falling back to cargo run (clarifies dev vs prod) - Document stdin limitation in tool description (ask_user not available) - Add code comment explaining allowed_paths inheritance is intentional Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Feedback AddressedImplemented
Skipped
|
Code ReviewSummaryThis PR adds a Issues FoundCriticalNone ImportantNone Suggestions
Previously Addressed (Filtered)
VerdictREQUEST_CHANGES - Two minor suggestions around code clarity. The implementation is solid and addresses the linked issue #78 well. Automated review by Claude Code |
- Document task tool parameters, returns, limitations - Update kill_shell to mention it works with task tool too - Add task tool use cases to "When to Use Which Tool" table Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code ReviewSummaryThis PR adds a Issues FoundCriticalNone ImportantNone SuggestionsNone Previously Addressed (Filtered)
VerdictAPPROVE - The implementation is solid and addresses the linked issue #78 well. The task tool design is clean, the event-driven refactoring for tool output is well-structured, and the integration test framework provides good coverage. Previous feedback has been addressed appropriately. Automated review by Claude Code |
Code ReviewSummaryThis PR adds a Issues FoundCriticalNone ImportantNone SuggestionsNone Previously Addressed (Filtered)
VerdictAPPROVE - The implementation is solid and fully addresses the linked issue #78. The task tool design is clean, reusing the existing Automated review by Claude Code |
Makes MCP config portable across machines by using $HOME instead of hardcoded absolute path. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code ReviewSummaryThis PR adds a Issues FoundCriticalNone ImportantNone SuggestionsNone Previously Addressed (Filtered)
VerdictAPPROVE - The implementation is solid and fully addresses the linked issue #78. Key strengths:
Automated review by Claude Code |
Machine-specific paths don't work with $HOME expansion, so keep .mcp.json gitignored and provide an example template for users to copy. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
c5c83b4 to
98b6862
Compare
Code ReviewSummaryThis PR adds a Issues FoundCriticalNone ImportantNone SuggestionsNone Previously Addressed (Filtered)
VerdictAPPROVE - The implementation is solid and fully addresses the linked issue #78. Key strengths:
Automated review by Claude Code |
Code ReviewSummaryThis PR adds a Issues FoundCriticalNone ImportantNone SuggestionsNone Previously Addressed (Filtered)
VerdictAPPROVE - The implementation is solid and fully addresses the linked issue #78. Key strengths:
Automated review by Claude Code |
Summary
tasktool that spawns clemini subprocesses to handle delegated workBACKGROUND_TASKSregistry sokill_shellworks for both bash and task processesChanges
src/tools/task.rswith TaskTool implementationNEXT_TASK_IDpub(crate) in bash.rs for reuseCleminiToolServiceDesign Decisions
BACKGROUND_TASKScurrent_exe()first,cargo runfallbackTest plan
get_clemini_command()and declarationmake clippypassesmake fmtpassesmake testpassesCloses #78
🤖 Generated with Claude Code