Summary
Add subscription-backed model support as a first-class Loomkin runtime path, while keeping the current API-key req_llm path fully functional.
This is the umbrella issue. The implementation is split so we can ship in stages, verify each provider path properly, and avoid one huge risky PR.
Problem
- Loomkin currently routes model execution through API-key provider flows only.
- There is no subscription OAuth lifecycle in the app yet (auth start, callback, refresh, revoke).
- Current config parsing does not yet support subscription auth/provider sections as first-class runtime config.
- Provider discovery and cost tracking are currently tuned for API-key usage, not subscription-backed auth/accounting modes.
Verified Constraints (as of March 3, 2026)
- Runtime model calls are driven by
provider:model strings and ReqLLM.stream_text/3.
- No
/login auth command/callback flow exists in the current LiveView/router stack.
req_llm in this repo supports zai_coder and zai_coding_plan already.
- Moonshot/MiniMax need explicit provider strategy in Loomkin runtime (native provider module, registered custom provider, or dependency update path).
Delivery Plan (Split)
This umbrella is delivered by:
Scope
In scope
- Subscription auth foundation (OAuth lifecycle, token lifecycle, secure storage).
- Anthropic subscription adapter path.
- Codex and Gemini subscription adapter paths.
- Coding-plan API provider path for Z.AI, Moonshot, and MiniMax.
- Cost and budget semantics for subscription-backed requests.
Out of scope
- Removing or replacing existing API-key model execution.
- Shipping all providers in a single PR.
- Unrelated agent-loop architecture rewrites.
Cross-Issue Requirements
- Backward compatibility: existing API-key model flow must keep working.
- Explicit fallback behavior when subscription auth is missing/expired/disabled.
- Token/account secrets must be redacted in logs, events, and UI surfaces.
- Config validation errors must be actionable and user-facing.
- Subscription-backed usage must produce deterministic budget behavior.
Umbrella Acceptance Criteria
Implementation Touchpoints
lib/loomkin/config.ex
lib/loomkin/models.ex
lib/loomkin/agent_loop.ex
lib/loomkin/session/architect.ex
lib/loomkin/teams/agent.ex
lib/loomkin/teams/cost_tracker.ex
lib/loomkin/teams/pricing.ex
lib/loomkin_web/live/workspace_live.ex
lib/loomkin_web/live/model_selector_component.ex
lib/loomkin_web/router.ex
Related GitHub Issues
Summary
Add subscription-backed model support as a first-class Loomkin runtime path, while keeping the current API-key
req_llmpath fully functional.This is the umbrella issue. The implementation is split so we can ship in stages, verify each provider path properly, and avoid one huge risky PR.
Problem
Verified Constraints (as of March 3, 2026)
provider:modelstrings andReqLLM.stream_text/3./loginauth command/callback flow exists in the current LiveView/router stack.req_llmin this repo supportszai_coderandzai_coding_planalready.Delivery Plan (Split)
This umbrella is delivered by:
Scope
In scope
Out of scope
Cross-Issue Requirements
Umbrella Acceptance Criteria
Implementation Touchpoints
lib/loomkin/config.exlib/loomkin/models.exlib/loomkin/agent_loop.exlib/loomkin/session/architect.exlib/loomkin/teams/agent.exlib/loomkin/teams/cost_tracker.exlib/loomkin/teams/pricing.exlib/loomkin_web/live/workspace_live.exlib/loomkin_web/live/model_selector_component.exlib/loomkin_web/router.exRelated GitHub Issues