mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-20 00:15:16 +00:00
feat(cron): per-job LLM provider/model override (#1234)
makeCronJobHandler builds the agent RunRequest with no provider/model, so cron jobs always run on the agent default provider. High-frequency scheduled jobs (e.g. triage) can't be routed to a cheaper model the way heartbeats already can via agent_heartbeats.provider_id/model. Add provider_id/model to cron_jobs (Postgres migration 000074; SQLite schema + migration v42→43, both mirroring agent_heartbeats) and resolve them into RunRequest.ProviderOverride/ModelOverride in the handler, reusing the existing per-run override plumbing that heartbeats use. NULL/unset → agent default, so existing jobs are unaffected. Settable today via UpdateJob patch (CronJobPatch.ProviderID/Model) or directly in the DB; tool/RPC/dashboard exposure left as a follow-up. Verified: go build ./... and go build -tags sqlite ./... (exit 0), go vet, gofmt, and cron unit tests on both pg and sqlite stores.
This commit is contained in:
1 parent
fc308a3989
commit
2bf0f9e172
18 files changed
+151
-22
No files matched your search
@@ -470,6 +470,8 @@ CREATE TABLE IF NOT EXISTS cron_jobs (
|
||||
deliver_channel TEXT NOT NULL DEFAULT '',
|
||||
deliver_to TEXT NOT NULL DEFAULT '',
|
||||
wake_heartbeat INTEGER NOT NULL DEFAULT 0,
|
||||
provider_id TEXT REFERENCES llm_providers(id) ON DELETE SET NULL,
|
||||
model VARCHAR(200),
|
||||
next_run_at TEXT,
|
||||
last_run_at TEXT,
|
||||
last_status VARCHAR(20),
|
||||
|
||||
Reference in new issue
Block a user