Skip to content

feat(cron): add configurable inference provider for AI tasks - #65

Open
octo-patch wants to merge 1 commit into
cytostack:mainfrom
octo-patch:octo/20260729-provider-add-recvqaBbZFnzTO
Open

feat(cron): add configurable inference provider for AI tasks#65
octo-patch wants to merge 1 commit into
cytostack:mainfrom
octo-patch:octo/20260729-provider-add-recvqaBbZFnzTO

Conversation

@octo-patch

Copy link
Copy Markdown

Reason: The cron AI task runner is hard-wired to the claude CLI subscription with no way to select a configurable inference provider or its endpoints.

What changed

  • Add src/daemon/providers.ts: an inference provider registry. It ships a MiniMax entry exposing both of its models (MiniMax-M3, 1,000,000-token context; MiniMax-M2.7, 204,800-token context) and both regional endpoints (global_enhttps://api.minimax.io, cn_zhhttps://api.minimaxi.com), plus a resolveProviderConfig resolver that validates the selected provider, region, and model.
  • Wire runAiTask in src/daemon/cron-engine.ts to honor an optional openwolf.cron.provider selection block. When set, the claude CLI is pointed at the provider's Anthropic-compatible base URL (ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN) and asked for the selected model via --model; the API key is read from the provider's environment variable (MINIMAX_API_KEY). When unset, the existing subscription-credential behavior is unchanged.
  • Add "provider": null to the cron block of the config template — a backward-compatible default that keeps current behavior until a provider is configured.
  • Document cron.provider (id, region, model, key env) in docs/configuration.md.
  • Add tests/providers.test.ts covering registry resolution, default and CN region/model selection, case-insensitive ids, and the unknown-provider/region/model error paths. These run under the repository's existing node --test tests/*.test.ts suite.

Checks

  • npx tsc --noEmit — passes.

Add a provider registry (src/daemon/providers.ts) and wire the cron
ai_task runner to an optional openwolf.cron.provider selection. When a
provider is configured, the claude CLI is pointed at its
Anthropic-compatible regional endpoint and asked for the selected model;
default subscription behavior is unchanged when unset. Ships a MiniMax
provider with its two models and global/CN endpoints, docs, and tests.
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