Skip to content

feat: agentflare-jobs crate — background job queue + process supervisor for agent CLIs - #298

Merged
getappz merged 6 commits into
masterfrom
feat/agentflare-jobs
Jul 22, 2026
Merged

feat: agentflare-jobs crate — background job queue + process supervisor for agent CLIs#298
getappz merged 6 commits into
masterfrom
feat/agentflare-jobs

Conversation

@getappz

@getappz getappz commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

Fixed during review (see #205 for full notes):

  • 3x clippy redundant_closure in queue.rs
  • Removed unused rand dependency
  • cargo fmt

Known limitations (tracked as follow-up, not blocking)

  • No crash recovery: a job stuck in running when a worker thread panics or the process dies is never reclaimed. Follow-up item filed.
  • No retry backoff — failed jobs re-queue immediately.
  • 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-features clean
  • cargo clippy -p agentflare-jobs --all-targets --all-features -- -D warnings clean
  • cargo test -p agentflare-jobs — 8/8 passed, including a real subprocess-spawn test
  • cargo test --workspace — 727 passed, 0 failed

Closes item #205.

getappz added 2 commits July 21, 2026 22:49
…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
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@getappz, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 4 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0c6abb7c-76fb-452d-bf9f-5e91599dd2fc

📥 Commits

Reviewing files that changed from the base of the PR and between a827402 and 86f8433.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • Cargo.toml
  • crates/agentflare-jobs/Cargo.toml
  • crates/agentflare-jobs/src/lib.rs
  • crates/agentflare-jobs/src/queue.rs
  • crates/agentflare-jobs/src/supervisor.rs
  • crates/agentflare-jobs/src/types.rs
  • crates/agentflare-jobs/src/worker.rs
  • crates/agentflare-jobs/tests/queue_test.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/agentflare-jobs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@getappz

getappz commented Jul 21, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@getappz
getappz enabled auto-merge (squash) July 21, 2026 19:04
getappz added 4 commits July 22, 2026 10:35
…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
@getappz
getappz merged commit 223e64a into master Jul 22, 2026
17 checks passed
@getappz
getappz deleted the feat/agentflare-jobs branch July 22, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant