mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
Scheduled tasks used the model selector in model-only mode, so a task could store a third-party model id without the provider runtime needed to execute it. The desktop task editor now stores the selected provider with the model, and the scheduler injects the same provider-scoped runtime env that desktop sessions use before launching the sidecar. Constraint: Scheduled tasks run outside an active desktop websocket session, so provider runtime must be serialized on the task itself. Rejected: Reuse session runtime localStorage for tasks | scheduled executions can run long after the UI session is gone. Confidence: high Scope-risk: moderate Directive: Keep task execution provider env isolated from inherited process env; stale parent ANTHROPIC_* values must not override task provider choices. Tested: cd desktop && bun run test -- src/components/tasks/NewTaskModal.test.tsx src/components/controls/ModelSelector.test.tsx Tested: bun test src/server/__tests__/scheduled-tasks.test.ts src/server/__tests__/cron-scheduler-launcher.test.ts Tested: bun run check:desktop Tested: bun run check:server Tested: git diff --check Not-tested: Live third-party provider API call; covered by sidecar launch integration with provider proxy env.