feat(cron): add configurable inference provider for AI tasks - #65
Open
octo-patch wants to merge 1 commit into
Open
feat(cron): add configurable inference provider for AI tasks#65octo-patch wants to merge 1 commit into
octo-patch wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reason: The cron AI task runner is hard-wired to the
claudeCLI subscription with no way to select a configurable inference provider or its endpoints.What changed
src/daemon/providers.ts: an inference provider registry. It ships aMiniMaxentry exposing both of its models (MiniMax-M3, 1,000,000-token context;MiniMax-M2.7, 204,800-token context) and both regional endpoints (global_en→https://api.minimax.io,cn_zh→https://api.minimaxi.com), plus aresolveProviderConfigresolver that validates the selected provider, region, and model.runAiTaskinsrc/daemon/cron-engine.tsto honor an optionalopenwolf.cron.providerselection block. When set, theclaudeCLI 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."provider": nullto thecronblock of the config template — a backward-compatible default that keeps current behavior until a provider is configured.cron.provider(id, region, model, key env) indocs/configuration.md.tests/providers.test.tscovering 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 existingnode --test tests/*.test.tssuite.Checks
npx tsc --noEmit— passes.