feat: agentflare-jobs crate — background job queue + process supervisor for agent CLIs - #298
Conversation
…s supervisor Persistent SQLite-backed job queue for spawning AI agent CLIs. Replaces fang with lean rusqlite + existing db_kit infra. - Queue: enqueue, atomic dequeue (Immediate tx), retry with backoff, list/get/cancel/cleanup - Supervisor: process spawn with file-logged stdout/stderr, timed kill (SIGTERM→SIGKILL / taskkill), thread-drained pipes - WorkerPool: thread-based N-worker pool polling queue - 8 integration tests passing - Zero new deps beyond rand (uses workspace rusqlite, db_kit, parking_lot, serde) AgentJob builder provides .arg().env().cwd().timeout().max_retries() for configuring agent CLI invocations. Cargo.toml: added crates/agentflare-jobs to workspace members Agentflare-Agent: claude-code_2-1-216_agent Agentflare-Branch: HEAD
… dep, fmt Agentflare-Agent: claude-code_2-1-216_agent Agentflare-Branch: feat/agentflare-jobs
|
Warning Review limit reached
Next review available in: 4 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (8)
✨ 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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
…askkill fails silently kill_graceful shells out to kill/taskkill and swallows their errors. If the binary is missing, permission is denied, or the process can't be signaled for any other reason, the process may still be alive when the caller calls child.wait() next, which then blocks forever. Agentflare-Agent: claude-code_2-1-216_agent Agentflare-Branch: feat/agentflare-jobs
# Conflicts: # Cargo.lock Agentflare-Agent: claude-code_2-1-216_agent Agentflare-Branch: feat/agentflare-jobs
Agentflare-Agent: claude-code_2-1-216_agent Agentflare-Branch: feat/agentflare-jobs
Agentflare-Agent: claude-code_2-1-216_agent Agentflare-Branch: feat/agentflare-jobs
Summary
agentflare-jobscrate: SQLite-backed durable job queue + process supervisor for spawning/monitoring headless agent-CLI subprocesses (timeout, graceful kill, retry-with-bookkeeping, stdout/stderr capture to files).AgentJobbuilder →Queue(enqueue/dequeue/complete/fail-retry/cancel/list/cleanup) →WorkerPool(thread pool polling the queue, running each job throughSupervisor::spawn()).leasesmodule; this is process supervision for external agent CLIs, its own SQLite file).Fixed during review (see #205 for full notes):
redundant_closureinqueue.rsranddependencycargo fmtKnown limitations (tracked as follow-up, not blocking)
runningwhen a worker thread panics or the process dies is never reclaimed. Follow-up item filed.WorkerPool::shutdown()isn't preemptive — waits for the in-flight job's timeout/kill-after to naturally resolve.Test plan
cargo build -p agentflare-jobs --all-featurescleancargo clippy -p agentflare-jobs --all-targets --all-features -- -D warningscleancargo test -p agentflare-jobs— 8/8 passed, including a real subprocess-spawn testcargo test --workspace— 727 passed, 0 failedCloses item #205.