142 Commits

Author SHA1 Message Date
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
hkfires
7ab999a80f fix(config): add NormalizeHomePort function and update home port handling 2026-08-30 08:59:04 +08:00
sususu
3e20d662a7 Revert "fix(home): allow home config to override default port"
This reverts commit 1502ac826d.
2026-08-28 11:38:17 +08:00
sususu
1502ac826d fix(home): allow home config to override default port 2026-08-26 15:17:16 +08:00
hkfires
448893290d fix(main): ensure safe closure of homeClient to prevent idle connections 2026-08-01 13:34:30 +08:00
hkfires
5243b38ab7 feat(pluginstore): implement plugin synchronization and validation
- Introduced PluginSyncRequest and PluginSyncResponse types for managing plugin synchronization.
- Added validation logic for plugin sync responses, including checks for schema version and expiration.
- Implemented functionality to clear sensitive data from plugin sync requests and responses.
- Enhanced error handling for HTTP requests related to plugin synchronization.
- Updated manifest validation to reject artifact URLs containing credentials or query parameters.
- Added tests for plugin synchronization, ensuring proper validation and error handling.
- Refactored existing code to support resolved authentication configurations for plugin downloads.
2026-07-17 08:09:05 +08:00
sususu98
4fe2c60c51 feat(registry): remote-refresh Codex client model catalog (#4276)
Load codex_client_models.json like models.json with validation, revisioned
handler reloads, CI bake, and Home-aware updater gates so list IDs still
come from Home while templates can refresh on the edge.
2026-07-13 17:47:35 +08:00
Luis Pater
35dba9b412 chore(models): update default client version and user agent, revise GPT-5.6 Sol configuration
- Incremented `defaultClientVersion` and `defaultCodexUserAgent` to `0.144.1`.
- Replaced GPT-5.5 with GPT-5.6 Sol in model registry, updating metadata including context window length, reasoning levels, and description.
- Enhanced model metadata with adjusted parameters, reasoning format, and new effort levels.
2026-07-10 12:46:09 +08:00
Luis Pater
b4c594050e chore(models): update default client version and user agent, revise GPT-5.5 configurations
- Bumped the `defaultClientVersion` and `defaultCodexUserAgent` to `0.144.0`.
- Replaced GPT-5.6 Sol with GPT-5.5 in model registry, adjusting metadata including context window length and reasoning levels.
- Updated `usage_helpers` to include `cache_write_tokens` logic for input token details.
2026-07-10 01:54:37 +08:00
hkfires
df08038941 fix: allow management access in example API key safe mode
Start the normal server when template api-keys are detected, but keep proxy API endpoints disabled until the keys are updated.

Show the warning page on / and /management.html, add a button to open the management panel via /management.html?safe-mode=configure, and remove the old warning-only server path.

Fixes #4063
2026-07-04 08:49:59 +08:00
Luis Pater
3a13865db8 refactor(home): relocate and rename home plugin status reporting logic
- Moved `reportHomePluginStatus` from `cmd/server` to `internal/home` as `ReportPluginStatus`.
- Updated interface and variable names for consistency.
- Adjusted imports and references in `main.go` and test files to align with the changes.
- Improved code structure for better modularity and reuse.
2026-06-23 23:27:11 +08:00
hkfires
e9a11db7b9 feat(home): enhance plugin management and synchronization
- Added NodeID field to HomeConfig for better identification.
- Updated ConfigFromJWT to populate NodeID from claims.
- Introduced new Redis keys for managing plugin status and tasks.
- Implemented RPushPluginStatus and GetPluginTasks methods in the client for handling plugin-related data.
- Enhanced Sync functionality to include detailed reporting on plugin installation and deletion tasks.
- Added error handling and reporting for plugin synchronization failures.
- Created tests for new plugin synchronization and management features.
- Improved the overall structure and readability of the plugin synchronization logic.
2026-06-23 20:42:33 +08:00
hkfires
c58da381c7 feat(plugins): sync home plugin manifests 2026-06-22 22:25:44 +08:00
Luis Pater
041a065b2f Merge branch 'remove-gemini-cli' into dev
# Conflicts:
#	internal/api/handlers/management/auth_files.go
#	internal/thinking/provider/geminicli/apply.go
2026-06-19 14:40:29 +08:00