Move provider auth and OAuth flows onto pi-ai Models, compose models.json and extension overlays through ModelRuntime, and retain ModelRegistry as an extension compatibility facade.
mai-code-1-flash-picker is not accessible via /chat/completions and
must use the Copilot /responses endpoint. Update generate-models.ts to
send mai-* models to the responses API and regenerate the affected
model entry.
Cloudflare Workers AI / AI Gateway resolved provider config from the
credential only, never consulting ambient env for a field the credential
omitted. The coding-agent /login flow stores just the API key, so
CLOUDFLARE_ACCOUNT_ID lives only in the environment; the key-only credential
short-circuited the env lookup, the account id stayed unresolved, and requests
hit the literal {CLOUDFLARE_ACCOUNT_ID} base URL -> 404.
resolveValue now merges per field: prefer the credential value, fall back to
ctx.env(name).
closes#6021
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
This adds cache-friendly dynamic tool loading anchored to tool results. Purely additive active-tool changes are recorded with `addedToolNames`, allowing supported Anthropic and OpenAI Responses models to load tool definitions at the point they become available instead of placing them in the cached prompt prefix.
It retains safe fallback behavior for unsupported models and non-additive changes but it will wipe caches.
Updates GitHub Copilot built-in model metadata so models with GitHub's extended 1M capability use contextWindow 1000000 in Pi, preventing early compaction and under-budgeting for Claude Opus 4.7/4.8 and GPT-5.3 Codex/5.4/5.5.
Verified against raw docs markdown extended-capabilities table and live /models reports.
closes#6439
Use the new provider-specific Xiaomi Token Plan catalogs from models.dev instead of cloning the API-billing Xiaomi catalog into every token-plan region. This removes API-billing-only models such as mimo-v2-omni from xiaomi-token-plan-{cn,ams,sgp}.
OpenAI Completions and Responses providers unconditionally replaced empty
tool result text with "(see attached image)", even when the result had no
image content. This caused the model to hallucinate image attachments for
commands that produce no output (e.g. curl -s with SSL errors, grep with
no matches, true/false).
Now matches the Google provider behavior: "(see attached image)" is only
used when images are actually present; empty results get "(no tool output)".
Co-authored-by: tzwm <tzwm@users.noreply.github.com>
Co-authored-by: Mario Zechner <badlogicgames@gmail.com>