fix: CLI headless recipe runs fail with 'Scheduler not available' error on Linux AARCH64 (v1.18.0+) #6416
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #6405
Summary
Issue #6405 Fix Summary
Problem
CLI headless recipe runs were failing with the error:
This occurred because in CLI mode (
goose run --recipe), theAgentwas created without initializing the scheduler service, while in server mode theAgentManagerproperly initialized it.Root Cause
In
crates/goose-cli/src/session/builder.rs, thebuild_sessionfunction creates anAgentbut never callsagent.set_scheduler(). In contrast,crates/goose/src/execution/manager.rs(AgentManager) properly initializes the scheduler viaScheduler::new()and sets it on the agent.Fix
Modified
crates/goose-cli/src/session/builder.rsto initialize the scheduler in exactly the same way as the server does:Added imports:
use goose::config::paths::Paths;use goose::scheduler::Scheduler;After creating the Agent, added scheduler initialization:
Changes
crates/goose-cli/src/session/builder.rsVerification
cargo check -p goose-cli- PASSEDcargo fmt- PASSED./scripts/clippy-lint.sh- PASSEDNotes
AgentManager::new()/tmp/test_scheduler_cli.rsto verify the issue (not added to git)Generated by goose Issue Solver