Commit Graph

155 Commits

Author SHA1 Message Date
Luis Pater
ca43428b98 Revert "fix(antigravity): set X-Goog-User-Project header on Cloud Code PA requests"
This reverts commit acf238f6a9.
2026-11-22 17:35:10 +08:00
Luis Pater
acf238f6a9 fix(antigravity): set X-Goog-User-Project header on Cloud Code PA requests
- Attach X-Goog-User-Project whenever a non-empty project_id is available across generation, countTokens, fetchAvailableModels, credits loadCodeAssist, PrepareRequest, HttpRequest, and fetch_antigravity_models requests before custom header overrides.
- Scope automatic injection in PrepareRequest and HttpRequest to Cloud Code PA endpoints or matching per-auth base_url targets, and clear stale headers when switching credentials on a reused request.
- Apply cross-origin redirect header stripping across Antigravity executor HTTP clients and disable redirects in fetch_antigravity_models so project IDs cannot leak across origins.

Closes: #7837
2026-11-22 15:47:36 +08:00
Luis Pater
6960763455 feat(management): persist server identity and expose it to authenticated clients 2026-11-22 02:48:47 +08:00
Luis Pater
4ea1527c94 fix(antigravity): wire version updater into service lifecycle and honor proxy config
- Start the Antigravity Hub version updater from Service.startModelCatalogUpdaters with a live config proxy provider, remove duplicate background startup calls from cmd/server/main.go, and keep the legacy single-argument sdk/auth.StartAntigravityVersionUpdater idempotent while an updater is active.
- Route manifest fetches in internal/misc/antigravity_version.go through proxyutil.BuildHTTPTransport without silent direct fallback on invalid proxy URLs and release per-fetch idle connections cleanly.
- Add unit and service lifecycle regression tests covering configured proxies, direct mode, invalid proxies, hot-reloaded proxy updates, and legacy wrapper idempotency.

Closes: #7822
2026-11-22 02:34:57 +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
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
Luis Pater
5f7c055366 fix(codex): synthesize baseline model from visible API-supported template and deflake wstunnel auth test
- Select the highest-priority visible API-supported model with a priority service tier when synthesizing the `gpt-5.5` baseline entry in `fetch_codex_models`, decoupling `minimal_client_version` and regenerating `codex_client_models.json`.
- Normalize non-template fallback `minimal_client_version` and `input_modalities` in the Codex client catalog builder and check for the `priority` service tier explicitly in `TestModelsWithClientVersionReturnsCodexCatalog`.
- Wait for pre-connected test servers to become visible via `waitServersVisible` before asserting the `server_list` snapshot in `TestHubAuth_MethodAndCredentials`.

Closes: #7697
2026-11-20 00:27:57 +08:00
Luis Pater
a5e8f69e56 feat(codex): add GPT-6.2 models and update CLI version
- Add GPT-6.2 Astra and Sol to Codex team, plus, and pro model registries.
- Update the model fetcher’s default Codex client version to 0.169.0.
2026-11-18 06:17:42 +08:00
Luis Pater
508f8708d0 chore: replace standard JSON package with moego JSON throughout the project 2026-11-16 09:58:12 +08:00
Luis Pater
f93d5cba95 fix(cmd): return non-zero exit status on config load, TUI, and service startup failures
- Route pre-configuration startup logs to stderr and return exit status 1 from a deferred-safe run helper when config loading, store bootstrap, or TUI execution fails.
- Propagate synchronous proxy service build and runtime errors from StartServiceWithPluginHost to stderr and exit status 1 while preserving exit status 0 on graceful context cancellation.
- Add subprocess and unit regression tests covering missing config, malformed YAML, TUI failures, occupied ports, and interrupt shutdown.

Closes: #7459
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
2026-11-12 03:23:19 +08:00
whale9820
bebd92c4c8 feat(cmd): add -login-proxy flag for CLI OAuth logins
Route the CLI OAuth flow through a chosen proxy and persist it as the
new credential's proxy_url, matching the management API's session
proxy behavior.
2026-11-09 15:08:55 +08:00
Luis Pater
68cd75724e fix(codex): prevent replay after uncertain refresh outcomes
- Preserve refresh failure stages and prevent immediate or later grant replay.
- Coordinate durable claims and recovery receipts across file, PostgreSQL, Git, and S3 stores.
- Add regression coverage for retries, concurrency, persistence, and recovery.

Closes: #7289
2026-11-07 01:44:42 +08:00
Luis Pater
6e6afab99a refactor: migrate gjson, sjson, and base64 to MoeForge/moego
- Replace tidwall/gjson and tidwall/sjson with github.com/MoeForge/moego/ojson
  and encoding/base64 with github.com/MoeForge/moego/base64 across the main
  module and examples
- Introduce cross-method *ojson.Doc request rewriting pipelines across
  thinking, signature, client/codex, runtime/executor/helps, pluginhost, and
  all provider executors with FinalizePayloadDoc as the final semantic barrier
- Convert all consecutive JSON mutations (>= 2 Set/SetRaw/Delete operations)
  to batch edits on ojson.Doc
- Upgrade read-only byte paths to ojson.GetBytesNoCopy,
  ojson.GetManyBytesNoCopy, and util.ParseGJSONBytesNoCopy with explicit
  strings.Clone ownership protection across streaming and persistent state
- Use base64.StdEncoding.ValidateString for zero-allocation signature checks
  and base64.EncodeDataURL for single-allocation data URL construction
2026-11-03 03:05:04 +08:00
Luis Pater
3dae075de2 feat(devin): aggregate swe-2 lightning UIDs into swe-2-lightning model
- Aggregate -{level}-lightning compound suffixes into a single swe-2-lightning catalog entry and preserve the Lightning display name suffix across registry and fetch_devin_models.
- Resolve -lightning base models into stem-{effort}-lightning UIDs while passing through complete upstream lightning UIDs and regenerating the embedded Devin catalog.

Closes: #6975
2026-10-25 22:17:43 +08:00
Luis Pater
8df4e42ab9 fix(codex): advertise direct tool mode and disable responses lite for non-codex routes
- Set `tool_mode` to `"direct"` and disable `use_responses_lite` and `supports_reasoning_effort_updates` when normalizing Codex catalog entries for non-template models and non-Codex or mixed-provider routes.
- Reset `tool_mode`, `use_responses_lite`, and `supports_reasoning_effort_updates` when synthesizing a fallback `gpt-5.5` baseline template in `fetch_codex_models`.

Closes: #6769
2026-10-19 18:06:33 +08:00
Luis Pater
f943770075 feat(config): add PreapareConfigFileForUpload and seed remote storage with hashed secrets
- Add `PrepareConfigFileForUpload` to hash plaintext management secrets and clean legacy layouts before remote storage seeding.
- Update ObjectStore and PostgresStore seed paths to prepare configuration files prior to synchronization.
- Update server bootstrap to prepare template-copied configurations and prevent plaintext secrets from reaching remote stores.

Closes: #6628
2026-10-15 07:03:32 +08:00
Luis Pater
e240bd8432 fix(codex): fallback default model template when gpt-5.5 is missing 2026-10-12 12:11:03 +08:00
Luis Pater
7b0319fb1c feat(codex): support Sign in with ChatGPT 2026-10-12 11:45:25 +08:00
Luis Pater
34e73c75a3 fix(xai): add proxy support and semver validation to Grok CLI updater
- Pass configured proxy URL to the npm registry updater client
- Validate fetched versions against strict semver and minimum server version floor (`1.0.13`)
- Update default fallback client version to `1.0.46`
- Manage background updater lifecycle and context via service lifecycle initialization
2026-10-08 02:39:32 +08:00
Luis Pater
298649f677 Merge pull request #6446 from jellyfish-p/feat/grok-cli-dynamic-version
feat(xai): dynamically fetch latest Grok CLI version from npm registry with fallback
2026-10-08 02:30:27 +08:00
Jellyfish
90654da573 feat(xai): dynamically fetch latest Grok CLI version from npm registry with fallback
- Fetch latest @xai-official/grok client version from npm registry on startup
- Periodically refresh Grok CLI version every 3 hours without multiple retries
- Update hardcoded fallback version to 1.0.50 if npm registry is unreachable
- Dynamically inject active version into x-grok-client-version and User-Agent headers
2026-10-08 00:59:27 +08:00
Supra4E8C
7c41cd05e4 feat: add global server GitHub token configuration 2026-10-08 00:33:27 +08:00
Luis Pater
1672be5d25 feat(registry): support custom model catalog sources and dynamic reload
- Add `CatalogSources` configuration to allow overriding general, Codex, and Devin catalog sources via URLs or absolute local file paths
- Centralize model catalog fetch, validation, and scheduled background updates in `catalogUpdater`
- Support dynamic catalog source updates and hot reloading during service runtime
- Update `--local-model` flag to use embedded models as defaults while respecting explicit overrides

Closes: #6319
Closes: #5024
2026-10-04 13:35:09 +08:00
Luis Pater
c8a2bfe8f5 feat(models): add gpt-6.1-sol model
- Register GPT-6.1 Sol model configuration with reasoning levels and instructions
2026-09-30 02:26:25 +08:00
Luis Pater
59baf7314a feat(codex): extract and persist subscription plan type
- Extract `plan_type` from JWT claims and default missing values to `free`
- Include `plan_type` in token data, token storage, auth attributes, and file synthesis
- Ensure `plan_type` is maintained across token refresh flows
- Preserve empty map allocations during auth object cloning
2026-09-28 18:54:03 +08:00
Luis Pater
31f4cfab3f feat: migrate CLIProxyAPI to version 8 2026-09-27 14:42:26 +08:00
Luis Pater
ef9e71201e feat(tui): support remote management base URL for client mode
- Add `base-url` to `remote-management` configuration and `-management-base-url` command-line flag
- Resolve management API base URL with priority given to CLI flag over config file
- Update TUI client and app initialization to support custom remote HTTP/HTTPS endpoints
- Include `remote-management.base-url` in configuration diff watcher checks

Closes: #6144
2026-09-27 10:53:35 +08:00
Luis Pater
fc2c98d1ca feat(runtime): enhance Devin model aggregation and UID normalization
- Implement `splitDevinUID` for consistent UID splitting and effort extraction.
- Update model aggregation to handle thinking levels and merge variants.
- Refine display name cleaning logic to remove redundant suffixes.
- Adjust Devin catalog integration to exclude exposed thinking variants.
- Normalize and sort thinking levels with an extended rank scheme.

Closes: #6141
2026-09-27 02:03:55 +08:00
sususu
377747b8b6 fix(registry,cliproxy): set xai owned_by for Devin grok models and align Antigravity web search tests
- Map Devin grok models to xai owned_by in catalog and fetch_devin_models tool
- Update Antigravity fetched capability test to reflect gemini-pro-agent native web search support
- Fix formatting in test fixtures
2026-09-24 22:23:18 +08:00
Luis Pater
2430354330 feat(registry): update model definitions and bump codex client version to 0.155.0
- Add Claude Opus 5.5 and GPT-6 (Sol and Luna) model entries
- Add native web search capability metadata across Gemini and Antigravity models
- Bump default Codex client version to 0.155.0 in model fetching script
2026-09-23 02:41:31 +08:00
Luis Pater
a5ab69521f feat: add full support for kimi.ai oauth and runtime execution 2026-09-21 04:13:44 +08:00
Luis Pater
42ca5d3412 Merge PR #5502 feat/meta-provider into cpa/muse
Bring in native Meta (Muse Code) provider support while keeping the
existing Devin integration and original Meta commit history.
2026-09-15 12:05:40 +08:00
sususu98
9b52a49927 Merge pull request #5796 from router-for-me/feat/ai-gateway-discovery
feat(discovery): introduce mDNS/DNS-SD LAN service advertising and CLI discovery
2026-09-14 17:07:32 +08:00
sususu
13af6c002b fix(discovery): tighten scan timeout, flags, and TCP-only types
Load scan filters without full config normalization, honor --timeout
exactly, stop argv pre-scan at --, restart ads when interface indexes
change, and reject UDP DNS-SD service types.
2026-09-14 17:02:44 +08:00
sususu
7d68705432 fix(discovery): keep JSON scans clean and honor interface filters
Skip plugin bootstrap for legacy --discover/--discover-json so logrus
cannot prefix JSON stdout, and let CLI/config include lists scan
non-default adapters such as docker0.
2026-09-14 15:38:05 +08:00
sususu
20ec9b83a1 fix(discovery): close lifecycle and routing gaps 2026-09-14 15:14:49 +08:00
sususu
f341e07b94 fix(cmd/fetch_antigravity_models): support symlinked auth dir and multi-auth fallback 2026-09-14 13:58:06 +08:00
sususu
b9005770e6 fix(discovery): harden advertiser lifecycle and browse limits 2026-09-14 11:58:27 +08:00
sususu
3428110d49 feat(discovery): add LAN gateway discovery
Advertise _ai-gateway._tcp with API-protocol DNS-SD subtypes, refresh
on address changes, uniquify colliding instance names, and filter
discovery to physical LAN interfaces.
2026-09-14 10:54:46 +08:00
sususu
2683ec201d feat(cmd): add fetch_devin_models CLI tool for dynamic model catalog extraction 2026-09-13 23:34:43 +08:00
sususu
982cd124f9 feat(devin): add standalone devin_models.json catalog and remote updater 2026-09-13 23:34:43 +08:00
sususu
f94752762b feat(devin): add Devin/Cognition provider integration and CLI OAuth
Implement the full Devin/Cognition Connect-RPC provider support across all CPA endpoints (/v1/chat/completions, /v1/messages, /v1/responses), complete with binary protobuf wire framing, streaming tools/arguments delta handling, thinking/reasoning replay, and CLI OAuth authentication.

Key highlights:
- Wire Protocol & Streaming:
  * Implemented Connect-RPC uncompressed 5-byte framing (0x00 + 4-byte length + protobuf) for ApiServerService/GetChatMessage.
  * Implemented Devin protobuf encoder/decoder in internal/runtime/executor/helps/devin_wire.go, including ClientMetadata, prompts, tools, completion_config, and multimodal image handling (Prompt Field #10).
  * Stream frame consumption via interactions protocol, correctly mapping arguments_delta and tracking multiple sequential tool calls (currentToolCallActive).
  * Streaming thought summary and sealed.v1 signature deltas targeting the thinking step.

- Model Registration & Thinking Clamping:
  * Registered static fallback models in model_definitions.go (swe-2, claude-fable-5-1, gpt-6-astra, swe-1-7-lightning, glm-5-2, glm-5-3).
  * Configured ThinkingSupport with discrete levels per model family.
  * Implemented CPA-standard nearest-neighbor clamping for thinking levels (minimal/low -> medium, xhigh -> max for swe-2).
  * Mapped thinking effort to Devin upstream model UID (e.g. swe-2-medium, swe-2-high, swe-2-max).

- Sensitive Words & System Prompt Sanitization:
  * Added devin.sensitive-words configuration in internal/config/config_types.go and config.go, matching Antigravity conventions.
  * Supported zero-width space (\u200b) obfuscation in prompts, tools, and system instructions via SensitiveWordMatcher.
  * Stripped Claude Code billing headers (x-anthropic-billing-header:) and CLI identity signatures from system instructions and tool descriptions to avoid upstream content filter rejections.

- Signature Compatibility:
  * Added SignatureProviderSWE = "swe" recognizing sealed.v1.* reasoning signatures in internal/signature/provider_compatibility.go.
  * Propagated reasoning.encrypted_content on Responses API and thinking.signature on Messages API.

- Authentication:
  * Implemented Devin PKCE OAuth flow with loopback callback server and headless manual token/code paste (--no-browser).
  * Registered Devin authenticator in SDK and CLI (-devin-login flag).
  * Integrated with management OAuth session endpoints and credentials manager.
2026-09-13 23:34:43 +08:00
sususu
8461b4e91d chore(codex): update codex user-agent to 0.154.0 2026-09-11 00:30:24 +08:00
Kenny
c6e076ff41 Merge dev into feat/meta-provider and preserve both registry tests 2026-09-10 14:03:29 +00:00
Kenny
21aa46b603 chore(meta): keep provider PR scoped to Meta support 2026-09-05 04:23:06 +00:00
Luis Pater
c77b136943 feat(models): add gpt-6-astra model and update codex client configurations
- Add `gpt-6-astra` model specifications and capabilities to registry models.
- Update Codex client models configuration and instructions for `gpt-6-astra`.
- Bump default Codex client version and user-agent to `0.153.3` in model fetcher tool.
2026-09-05 03:35:14 +08:00
Kenny
fbf746459b fix(cli): make config optional in commandMode so login works without existing config.yaml 2026-09-04 13:41:24 +00:00
Kenny
54d4f4c019 feat(meta): add native Meta (Muse Code) provider and OAuth device flow 2026-09-04 13:41:24 +00:00
Luis Pater
c2834b68e6 fix(antigravity): retry model fetching per endpoint and prioritize daily base url
- Retry model fetch requests up to twice per endpoint before falling back to subsequent base URLs.
- Prioritize the daily base URL ahead of production in the default endpoint list.
- Allow injecting custom base URLs and HTTP clients to support testing and configurable fetch execution.

Closes: #4495
2026-09-01 20:46:41 +08:00