feat(consciousness): async tool execution (BRO-459)#53
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 18 minutes and 53 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…le (BRO-459) Move the agent tick loop from blocking the consciousness event loop to a spawned tokio task. The actor stays responsive to new messages, status queries, and timer ticks while the LLM call + tool execution runs concurrently. Key changes: - Add ToolResult, ToolFailed, CycleCompleted event variants - Add WaitingForTools mode (for future per-tool async) - Add self_tx (WeakSender) so spawned tasks send CycleCompleted back - Extract run_agent_cycle_inner as a static method for spawned tasks - drain_queue_after_run now spawns one cycle at a time (sequential via CycleCompleted -> drain chain) - WeakSender ensures channel-close detection still works when all external handles are dropped - 2 new integration tests: non_blocking_cycle_completes, cycle_completed_drains_queue Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fa3cf3b to
e847063
Compare
Summary
CycleCompleted,ToolResult,ToolFailedevent variants andWaitingForToolsmode for future per-tool asyncWeakSenderfor the self-referencing channel to preserve channel-close shutdown semanticsCycleCompleted->drain_queue_after_runchain (one cycle at a time)Changes
crates/arcand/src/consciousness.rs: Newspawn_agent_cycle+run_agent_cycle_innermethods, updated event loop andhandle_user_messagecrates/arcand/tests/consciousness_test.rs: 2 new integration tests (non_blocking_cycle_completes,cycle_completed_drains_queue)Test plan
cargo fmt --checkpassescargo clippy -p arcandpasses (zero warnings)cargo test -p arcand --test consciousness_test— 9/9 tests pass (7 existing + 2 new)cargo test --workspace— full workspace passes (zero failures)🤖 Generated with Claude Code