#8115·ironclaw

Add a Tsubasa registry entry with an explicit 32K context-budget path

Author: cenabCreated Sep 28, 2026Updated Sep 28, 2026

Add a Tsubasa registry entry with an explicit 32K context-budget path

Problem

IronClaw already has an OpenAI-compatible backend, but users configuring Tsubasa must enter the endpoint and model manually. A named provider could make credential setup and model selection clearer. Before exposing it as a normal agent choice, the 32,768-token combined input/output limit needs an explicit route through the existing context-budget configuration.

This is a feature proposal before implementation, following CONTRIBUTING.md. No provider feature code has been changed.

Proposed scope

Reuse ProviderProtocol::OpenAiCompletions and the existing Rig adapter. Add one declarative entry to crates/domains/ironclaw_llm/assets/providers.json with:

  • ID and display name tsubasa / Tsubasa.
  • Default base URL https://api.tsubasa.sh/v1, optional TSUBASA_BASE_URL, and required TSUBASA_API_KEY.
  • Default public alias tsubasa-pro, with tsubasa-fast also selectable as an explicit model.
  • The existing API-key setup hint. Keep model listing disabled until it is qualified.
  • The existing unsupported_params opt-out for prompt_cache_key: the shared adapter can otherwise attach this OpenAI-specific field when conversation metadata is present, while Tsubasa's request schema does not accept it.

Use the current registry/resolution owners rather than a new Rust provider module. Keep model facts separate from provider identity, as specified by the LLM module's CONTRACT.md. No tools, vision, reasoning, pricing, or privacy properties should be inferred from an OpenAI-compatible protocol.

Context-budget decision

The inspected PromptContextTokenBudget default is 128,000 tokens, while its fields can represent a smaller context ceiling and a reserved output budget. The declarative provider record itself has no context-window field, and LlmSlotSelection currently contains provider/model/key-env/base-URL selection only. Adding a provider label alone would not prove that an ordinary selected agent route stays inside Tsubasa's 32,768-token total.

Please confirm the intended owner/configuration path for a per-selected-model context limit before implementation. A qualification test should capture the complete native prompt, reserve a bounded output allowance such as 4,096 tokens, and check the actual admission budget. Long-history truncation and oversized single tasks must be covered; a short client greeting would not establish those properties.

Existing alternative

[llm.default] can select provider_id = "openai_compatible", a public alias, api_key_env = "TSUBASA_API_KEY", and base_url = "https://api.tsubasa.sh/v1". This uses the existing explicit credential and endpoint override path. It is a source-inspected configuration route, not a qualified full-agent preset.

Validation plan

Test registry parsing/selectability, explicit credential/endpoint precedence, the actual Rig JSON/SSE/401 path for both aliases, and complete prompt/output admission at 32,768 tokens. Run the owning crate's tests and module-charter checks plus the repository's required format, Clippy, build, and test commands. Reuse existing provider-chain assembly and shared hardened HTTP clients.

Inspected commit b0b999d96781516ee05e6ba961d6f3ead900da96, its registry, resolver, LLM module contract, config selection types, and prompt-budget contract. The unchanged budget module's three tests passed in an isolated Rust harness. No live Tsubasa inference or IronClaw request fixture is claimed. A Tsubasa issue/PR search found no existing contribution during this investigation.

Prepared with AI assistance. Maintainer scope approval is pending.