Commit Graph

7 Commits

Author SHA1 Message Date
hkfires
daecdc90ad feat(copilot): add auto model routing
Add the virtual copilot/auto model for accounts whose /meta
default tier is enabled, resolved from account plan and
published only while the entitlement remains valid.

Select concrete models via /auto with scoring and RL
multi-turn policies, bounded prompt history, token refresh,
duplicate handling, and expiry checks before inference.

Rebuild portable history across Chat, Responses, Messages,
and Gemini route switches, including stored response and
item continuations and Gemini tool-call ID normalization.

Keep Auto state scoped by account, caller, and explicit
session, and redact session and RL state tokens from logs.
2026-11-30 18:43:47 +08:00
hkfires
f110136af3 fix(thinking): clamp budgets to levels for OpenAI models
OpenAI Chat/Responses and xAI appliers accept effort levels
only, so numeric budgets on hybrid models were not clamped
to supported levels. Clear Min/Max on a copy of the model
info before conversion, preserving catalog capabilities.

Use ClampLevel for the Devin swe-1-7 medium variant so
budget-derived levels select the correct upstream UID.

Add regression tests for Copilot, Devin, and OpenAI-compat
chat covering body and suffix budgets across formats.
2026-11-23 22:45:56 +08:00
hkfires
d059cf2891 feat(copilot)!: add preset-based in-memory catalog
Add copilot presets to the registry models catalog and intersect
them with per-account /models capabilities, so usable credentials
get cold-start preset routes before discovery and account data
overrides limits, modalities, thinking and endpoint afterwards.

Replace the persisted metadata catalog with an immutable
in-memory Auth.CopilotCatalog with preset and unavailable
sentinels, preserving or revoking it across reloads, account
and origin changes, and re-resolving routes on each attempt.

Run discovery in a dedicated worker pool with per-account
transport, queued cancellation and skip-persist commits, gate
native-executor plugin models on catalog availability, and
remove login-time catalog fetch and embedded effort lists.

Add cmd/fetch_copilot_models to export the raw upstream /models
response atomically without modifying the stored credential.

BREAKING CHANGE: upstream-only Copilot models without a registry
preset are no longer routed, and the persisted copilot_catalog
metadata, ReadCatalog and string FetchCatalog APIs are removed
2026-11-21 17:11:35 +08:00
hkfires
20211183c5 fix(copilot): use execution mode for claude stream translation
Force the stream hint for the OpenAI-to-Claude response translator
whenever ExecuteStream is used, even if the original request set
stream:false or omitted it. Keep the original request unchanged
and add coverage for omitted, true, and false values.
2026-11-21 12:14:05 +08:00
hkfires
b824c05297 fix(copilot): return gemini format for count tokens
Use GeminiTokenCountJSON for Gemini-format requests instead of
falling back to OpenAI usage JSON, and reuse the shared Claude
input_tokens helper for Claude and OpenAI Response formats.
2026-11-21 10:58:18 +08:00
Luis Pater
5dff8b6728 feat(copilot): support OAuth model aliases and exact route-aware selection
- Publish Copilot catalog and plugin models with native IDs, aliases, and auth prefixes while preserving suffixed routes.
- Route requests through exact registered Copilot models and send the resolved native model upstream.
- Reconcile Copilot model states and route metadata against published routes; document Copilot support in OAuth alias and error configuration.
2026-11-21 09:54:53 +08:00
hkfires
7ae771fcb4 feat(copilot): add GitHub Copilot provider support
Add device OAuth login via `--copilot-login`, trusted-endpoint token
exchange, and per-account model catalog discovery with independent
refresh so accounts expose only entitled Chat, Messages, or Responses
routes.

Implement the executor with official CLI parity defaults, cross-protocol
translation, account-scoped thinking, turn linking, and server-side
replay of private reasoning and signatures, keeping payload rules final.
2026-11-20 23:14:11 +08:00