test(agent): wire TestRig job tools through the scheduler - #716
Conversation
Align TestRig with the production agent wiring so create_job exercises the real scheduler path instead of silently falling back to an unscheduled context-only job. Tighten the e2e assertion to lock in the in-progress scheduler behavior for future refactors. Made-with: Cursor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Pull request overview
This PR aligns the TestRig test harness with the production wiring in main.rs so that job tools share the agent's ContextManager and dispatch through the real Scheduler. Previously, register_job_tools in the TestRig used a standalone, freshly-created ContextManager and passed scheduler_slot: None, meaning create_job always fell back to the unscheduled path — causing tests to pass while bypassing actual scheduler wiring.
Changes:
- In
test_rig.rs: Replace the isolatedContextManager::new()withArc::clone(&components.context_manager)and pass a realSchedulerSlot(filled afterAgent::new) toregister_job_tools, mirroringmain.rsexactly. - In
test_rig.rs: PassSome(Arc::clone(&components.context_manager))toAgent::newso the agent's scheduler uses the same context store as the job tools. - In
e2e_builtin_tool_coverage.rs: Strengthen thejob_create_statustest to assert thatcreate_jobdispatches through the scheduler ("in_progress"present,"scheduler unavailable"absent).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/support/test_rig.rs |
Reuses components.context_manager and wires a real SchedulerSlot in register_job_tools; passes the same ContextManager to Agent::new; fills the slot after Agent::new to match production startup sequence |
tests/e2e_builtin_tool_coverage.rs |
Adds regression-guard assertions in job_create_status to ensure create_job returns "in_progress" and does not fall back to the "scheduler unavailable" path |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
zmanian
left a comment
There was a problem hiding this comment.
Mirrors production main.rs wiring exactly — shared ContextManager via Arc::clone, proper SchedulerSlot lazy-fill pattern, and Agent::new receives the shared context manager. Regression assertions verify create_job dispatches through the scheduler. Clean fix.
zmanian
left a comment
There was a problem hiding this comment.
LGTM - TestRig scheduler wiring.
Align TestRig with the production agent wiring so create_job exercises the real scheduler path instead of silently falling back to an unscheduled context-only job. Tighten the e2e assertion to lock in the in-progress scheduler behavior for future refactors. Made-with: Cursor Co-authored-by: Zaki Manian <zaki@iqlusion.io>
Align TestRig with the production agent wiring so create_job exercises the real scheduler path instead of silently falling back to an unscheduled context-only job. Tighten the e2e assertion to lock in the in-progress scheduler behavior for future refactors. Made-with: Cursor Co-authored-by: Zaki Manian <zaki@iqlusion.io>
Summary
tests/support/test_rig.rswith production wiring so job tools share the agent'sContextManagerand receive a lazySchedulerSlotAgent::new()socreate_jobin TestRig-backed e2e runs dispatch through the real scheduler pathscheduler unavailablefallback pathWhy
Issue #606 points out that the TestRig wasn't exercising the same job execution path as the real application. It registered job tools against a separate
ContextManagerwith no scheduler, so tests could pass while bypassing the actual scheduler wiring used in production.Tests
cargo fmt --checkcargo test --test e2e_builtin_tool_coverage job_create_status -- --nocapturetarget/debug/deps/e2e_builtin_tool_coverage-142df138fb18c392 --exact tests::job_list_cancel --nocaptureNotes
I had to clear the temporary
target/directory in this disposable local clone to recover disk space before the targeted test build. No source files outside this PR were changed.Made with Cursor