feat(sessions): per-job provider routing — distribute across quota buckets#244
Open
brianjones-v4n wants to merge 1 commit into
Open
feat(sessions): per-job provider routing — distribute across quota buckets#244brianjones-v4n wants to merge 1 commit into
brianjones-v4n wants to merge 1 commit into
Conversation
…ckets Today SessionManager.spawnSession launches config.claudePath for every session — interactive and scheduled. This adds optional per-job provider routing so background jobs can run on a cheaper local provider (Ollama wrapper) while interactive sessions stay on native Anthropic, letting operators balance work across two quota buckets. - types.ts: new ProviderConfig (claudePath, env, modelTiers); add providers: Record<string, ProviderConfig> to SessionManagerConfig; add optional provider: string to JobDefinition - SessionManager: spawnSession resolves claudePath, env, and the --model flag against the selected provider (or falls through to global config when no provider is set — full back-compat) - JobScheduler: passes job.provider to spawnSession - Config: loads sessions.providers from .instar/config.json Tier semantics preserved: jobs.json still uses opus/sonnet/haiku; each provider declares a modelTiers map translating those to its actual model identifier (e.g., Anthropic haiku→claude-haiku-4-5, Ollama haiku→qwen2.5:7b). Jobs that omit provider keep the existing behavior verbatim. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@brianjones-v4n is attempting to deploy a commit to the sagemind Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
Today
SessionManager.spawnSessionlaunchesconfig.claudePathfor every session — interactive and scheduled. This adds optional per-job provider routing so background scheduler jobs can be routed through a cheaper local provider (e.g., an Ollama wrapper runningclaudeagainst DeepSeek) while interactive Telegram-driven sessions stay on native Anthropic Claude. Operators get to balance work deliberately across two quota buckets.API surface
.instar/config.json:.instar/jobs.jsonentries gain"provider": "ollama"to opt in. Omittingproviderkeeps the existing behavior verbatim.Backward compatibility
providerproduce the same spawn command as before (same binary, same env, same--modelflag).sessions.providersblock work unchanged.jobs.jsonfiles withoutproviderwork unchanged.Test plan
model: "sonnet"→ provider's modelTiers.sonnet valuejob.providertoSessionManager.spawnSessionnpx tsc --noEmit— no new errors (9 pre-existing unchanged)npm run build— pre-existing 9 tsc errors unchanged (build script exits non-zero on pre-existing errors that exist on main;tscemits dist correctly withnoEmitOnErrorunset)Why tier semantics over provider-specific model names
Jobs stay portable.
"model": "sonnet"in a job means "the medium-tier model on whatever provider runs you" — providers translate to their own identifier. Operators retune the translation table without touching anyjobs.json.🤖 Generated with Claude Code