Skip to content

feat(harness): extract reusable run queue mechanics - #99

Merged
senamakel merged 2 commits into
tinyhumansai:mainfrom
senamakel:move-agent-inference-to-tinyagents
Aug 12, 2026
Merged

feat(harness): extract reusable run queue mechanics#99
senamakel merged 2 commits into
tinyhumansai:mainfrom
senamakel:move-agent-inference-to-tinyagents

Conversation

@senamakel

@senamakel senamakel commented Aug 12, 2026

Copy link
Copy Markdown
Member

Summary

  • add a generic, payload-agnostic active-run queue with steer, follow-up, and collected-context lanes
  • expose queue lane/status/types through the harness and crate root
  • move local OpenAI-compatible chat-template rejection classification beside the provider implementation
  • document the new harness ownership boundary

API Or Behavior Changes

Adds RunQueue<T>, QueueLane, QueueStatus, and is_chat_template_rejection_message as public APIs. Existing TinyAgents behavior is unchanged; these APIs let hosts reuse queue mechanics and local-runtime error recognition without importing host metadata.

Tests

  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo build --all-targets
  • cargo build --all-targets --all-features
  • cargo test
  • cargo test --all-features

Focused additions cover empty queues, lane routing, FIFO/lane isolation, clearing, wrapped chat-template failures, case-insensitive matching, and unrelated provider errors.

Documentation

Updated docs/modules/harness/README.md with the queue responsibility, source entry, and feature-ownership boundary.

Co-authored-by: Medulla <medulla@tinyhumans.ai>
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 54 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8acf953b-a207-480f-a575-1291349fa865

📥 Commits

Reviewing files that changed from the base of the PR and between 3e4bcad and 5e026cd.

📒 Files selected for processing (1)
  • docs/modules/harness/README.md
📝 Walkthrough

Walkthrough

The harness now exposes a thread-safe FIFO queue with steer, follow-up, and collect lanes. The OpenAI provider adds chat-template rejection detection with public re-export and tests. Harness documentation describes queue ownership and layout.

Changes

Active-run queue

Layer / File(s) Summary
Queue contract and wiring
src/harness/run_queue/types.rs, src/harness/mod.rs, docs/modules/harness/README.md
Defines queue lanes and status fields. Registers and documents the run_queue module.
Queue operations and validation
src/harness/run_queue/mod.rs, src/harness/run_queue/test.rs, src/lib.rs
Implements synchronized FIFO insertion, draining, status reporting, clearing, default construction, crate exports, and asynchronous tests.

OpenAI error detection

Layer / File(s) Summary
Chat-template rejection detection
src/harness/providers/openai/local.rs, src/harness/providers/openai/mod.rs, src/harness/providers/openai/local_test.rs
Matches known case-insensitive chat-template rejection phrases, re-exports the helper, and tests matching and exclusion cases.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Poem

I’m a rabbit with queues in a row,
Steer, follow-up, collect—off they go.
Errors now match with a careful ear,
Tests keep each pathway crystal clear.
Hop, hop—the harness is ready to grow!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 90.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: extracting reusable run queue mechanics for the harness.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/modules/harness/README.md`:
- Line 169: Update the queue module reference in the documentation from
run_queue.rs to the run_queue/ directory, matching the added
src/harness/run_queue/mod.rs layout.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1b010e59-0e3a-4e95-93ec-16892edc3d96

📥 Commits

Reviewing files that changed from the base of the PR and between 27a3f39 and 3e4bcad.

📒 Files selected for processing (9)
  • docs/modules/harness/README.md
  • src/harness/mod.rs
  • src/harness/providers/openai/local.rs
  • src/harness/providers/openai/local_test.rs
  • src/harness/providers/openai/mod.rs
  • src/harness/run_queue/mod.rs
  • src/harness/run_queue/test.rs
  • src/harness/run_queue/types.rs
  • src/lib.rs

Comment thread docs/modules/harness/README.md Outdated
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel merged commit c15d783 into tinyhumansai:main Aug 12, 2026
2 checks passed
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