Commit Graph

3632 Commits

Author SHA1 Message Date
Luis Pater
291cfb87ef feat(codex): support orphan delegation compatibility via orphan-delegation-compatibility
- Add `codex.orphan-delegation-compatibility` configuration option and mirror it to SDK configuration.
- Convert orphan Codex delegation outputs into standard user messages for requests with `X-Openai-Subagent: collab_spawn`.
- Integrate orphan delegation rewriting into OpenAI responses request handling pipeline.

Closes: #5401
2026-09-03 20:21:24 +08:00
Supra4E8C
93f5266b7b feat: add Swiftproxy Sponser 2026-09-03 20:11:55 +08:00
Supra4E8C
699b06594b feat: 添加 AxisNow 赞助信息及相关图像到 README 文件 2026-09-03 19:29:15 +08:00
Supra4E8C
ebbce50e08 chore: remove sponsorship images for Claude API and Code0 from README files 2026-09-03 19:21:48 +08:00
sususu98
e899f0e539 feat(session): derive distinct branch session ID, parent lineage on Merkle LCP forks, and enhance Codex fork/subagent affinity (#5418) (#5454) 2026-09-03 17:52:40 +08:00
Luis Pater
09471dd9da fix(auth): prevent individual model quota cooldowns from blocking credential
- Ignore aggregated single-model quota cooldowns during credential-level availability checks.
- Keep credentials eligible unless marked completely unavailable or subject to a credential-wide quota.

Closes: #5371
2026-09-03 17:49:57 +08:00
Luis Pater
d577e630b1 feat(routing): make subagent session affinity configurable via session-affinity-subagents
- Add routing.session-affinity-subagents (defaulting to true) to RoutingConfig.
- Unify subagent parent credential inheritance across all providers by removing hardcoded provider/model blacklists.
- When session-affinity-subagents is false, isolate subagents and distribute them via the fallback selector.
- Ensure changing session-affinity-subagents is a no-op when session-affinity is false.
- Preserve alias isolation and failure isolation invariants.

Closes: #5417
v7.2.148
2026-09-03 17:05:35 +08:00
Luis Pater
63fdd77f80 Merge pull request #5436 from router-for-me/models
fix(models): apply Home-provided model capabilities during execution
2026-09-03 16:32:54 +08:00
hkfires
cdda333cd2 fix(codex): clear unsupported reasoning levels 2026-09-03 13:25:56 +08:00
hkfires
c6dd82144b refactor(kimi): use request thinking helper 2026-09-03 13:10:30 +08:00
hkfires
6ff680e90a feat(auth): use home model capabilities for thinking 2026-09-03 13:10:30 +08:00
hkfires
1ecf0cb602 fix(models): preserve home model capability metadata 2026-09-03 13:10:29 +08:00
sususu
df7e04ea28 fix(claude): upgrade default Claude Code baseline and fingerprint to 2.1.258
- Bump default Claude Code version baseline from 2.1.220 to 2.1.258 to resolve upstream 400 version gate error
- Update Stainless SDK package version to 0.112.1 and runtime version to v26.3.0
- Refresh default device profile, billing header build hashes, and cloaking signatures
- Decouple unconfirmed client OS/Arch test assertions from host runner platform
- Update config.example.yaml and test suites across executor and helps packages
2026-09-03 10:21:13 +08:00
Luis Pater
18e01a76ac fix(auth): enforce minimum cooldown floor and track attempted credentials on 429
- Enforce a 10-second minimum cooldown floor for quota errors to prevent retry storms from sub-second `Retry-After` values.
- Track attempted authentication credentials per round across execution flows.
- Ensure credentials attempted during a failed 429 round respect the cooldown floor instead of triggering zero-wait retries.

Closes: #5265
2026-09-03 10:02:51 +08:00
Luis Pater
f416175fcd fix(home): map user_credits_insufficient to 402 and user_period_limit_exceeded to 429
- Map `user_credits_insufficient` to `402 Payment Required` in `decodeHomeDispatchError`.
- Map `user_period_limit_exceeded` to `429 Too Many Requests` in `decodeHomeDispatchError`.
- Add unit test coverage for billing and period limit error mappings.

Closes: #5170
2026-09-03 02:59:34 +08:00
Luis Pater
9812b1e768 fix(auth): validate access token expiration and retain valid credentials on refresh failure
- Parse and prioritize JWT `exp` claims when determining access token expiration.
- Retain active credentials and schedule backoff retries on refresh failures if the access token remains unexpired.
- Demote and block auth credentials with expired access tokens during model scheduling and candidate selection.
- Reduce Codex token refresh lead duration to 24 hours.

Closes: #5095
2026-09-03 01:33:11 +08:00
Luis Pater
bdcccfb8e0 chore(registry): remove "minimal" level from dynamic_allowed definitions in models
- Cleaned up unused "minimal" level from dynamic levels across multiple model definitions.
2026-09-02 23:33:22 +08:00
Luis Pater
dacae58228 feat(registry): add claude fable 5.1 and gemini 3.8 flash models
- Add `claude-fable-5-1` model definition with thinking configuration and multimodal capabilities.
- Add `gemini-3.8-flash` and `gemini-3.8-flash-high` model definitions across Google and Antigravity registries.
2026-09-02 23:27:56 +08:00
Luis Pater
272c1cff4e fix(antigravity): bypass quota cooldowns and credit hints when cooling is disabled
- Bypass short cooldown checks and recording in execution flows when cooling is disabled globally or per auth.
- Skip marking credits permanently disabled and refreshing credit hints when cooling is disabled.
- Export quota cooldown status helper functions for auth and configuration evaluations.

Closes: #4793
2026-09-02 22:01:55 +08:00
Luis Pater
d0fb44ca95 fix(antigravity): strip tool config, labels, and session id in token counting
- Strip `request.toolConfig`, `request.labels`, and `request.sessionId` from the payload before dispatching count tokens requests.

Closes: #4749
2026-09-02 21:08:21 +08:00
Luis Pater
02c02cda50 fix: harden concurrent session handling, listener lifecycle, and token accounting
- Use `context.AfterFunc` and buffered delivery in websocket relay sessions to avoid per-request goroutine leaks.
- Synchronize in-flight puts and drain queued connections upon mux listener close.
- Ensure home streaming log writer goroutines terminate cleanly when the log client is unhealthy.
- Prevent integer arithmetic overflow in token breakdown validations and calculations.
- Clone request headers in logging middleware to prevent concurrent mutation issues.
- Implement standard `io.WriterTo` return signature for file body sources.

Closes: #4709
2026-09-02 20:02:42 +08:00
Luis Pater
8deeb4ac31 fix(antigravity): preserve unsigned gemini thinking blocks with trailing carriers
- Precompute carrier context in signature validation to preserve unsigned Gemini thinking blocks followed by valid trailing carriers.
- Avoid dropping unsigned thinking blocks during request translation for Gemini models.
- Validate carrier directions and placement against adjacent semantic content blocks.

Closes: #4628
2026-09-01 21:56:18 +08: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
Luis Pater
15231e9fdc fix(antigravity): support native thinking signatures without prefixes in claude translator
- Emit provider-native signatures without model group prefixes in Claude responses.
- Validate client-provided signatures directly and restrict signature cache recovery to omitted signatures.

Closes: #4445
2026-09-01 20:36:26 +08:00
Luis Pater
893abbabc2 feat(translator): support cache write tokens in claude responses
- Extract cache write tokens from OpenAI and Codex usage details.
- Map cache write tokens to Claude `cache_creation_input_tokens` for streaming and non-streaming responses.

Closes: #4262
2026-09-01 19:56:40 +08:00
Luis Pater
17a65ee547 fix(codex): support reasoning_text in openai chat completion responses
- Handle `response.reasoning_text.delta` and `response.reasoning_text.done` stream events for delta reasoning content.
- Extract `reasoning_text` content from output reasoning items in non-streaming responses.

Closes: #5378
v7.2.147
2026-09-01 18:12:52 +08:00
sususu
dc0f7a594b fix(session): derive LCP session ID from rolling prefix keys and harden matcher
- root derived session ID in rolling prefix key to disambiguate conversations with different system prompts
- sanitize matcher config to guarantee MaxPrefixes >= MaxTurns
- tie-break tool parts sorting with digest for determinism
2026-09-01 18:00:13 +08:00
sususu
5679bbf330 fix(auth): optimize session cache LRU capacity eviction
- replace O(N log N) sorting under global write lock with container/list LRU eviction
- track primary alias groups for O(1) group lookup and clean group eviction
- capture timestamps inside lock and add nil receiver guards
2026-09-01 18:00:09 +08:00
sususu
acc1500f60 test(executor): update antigravity interactions test to use valid model 2026-09-01 18:00:04 +08:00
sususu
35e3d97dac fix(registry): remove defunct gemini-3-flash-agent model from antigravity provider
Remove gemini-3-flash-agent and legacy gemini-3.5-flash entries from the embedded antigravity model registry in models.json, as upstream Google Cloud Code / Antigravity endpoints return 500 UNKNOWN for these model IDs. Update excluded model tests to assert against active model gemini-pro-agent instead.
2026-09-01 15:26:57 +08:00
Luis Pater
fae57a3a88 fix(session): support identity and subagent extraction from nested request payloads
- Extract subagent IDs, user IDs, and prompt cache keys from nested `request` objects across session identity, session info, and auth selection.
- Normalize and fall back appropriately when top-level prompt cache key fields are empty strings.
- Inspect nested request fields when validating explicit session identities.
2026-09-01 11:23:38 +08:00
Chén Mù
ed37aa035c Merge pull request #5374 from router-for-me/home
Enhance homeDispatchConn with untrack method and improve connection closure handling
2026-09-01 09:40:15 +08:00
Chén Mù
9ca93840db Merge pull request #5373 from router-for-me/tests
Improve test reliability by avoiding wall-clock time
2026-09-01 09:36:29 +08:00
hkfires
22a57401a1 fix(tests): improve test reliability by avoiding wall-clock time in TTL and cache-eviction tests 2026-09-01 09:24:05 +08:00
hkfires
dbcc4ecd6f feat(home): enhance homeDispatchConn with untrack method and improve connection closure handling 2026-09-01 09:23:41 +08:00
hkfires
8bcae8cf20 docs: document timer granularity and sleep convention in AGENTS.md 2026-09-01 09:23:17 +08:00
Luis Pater
7070785140 fix(auth): preserve upstream status codes in antigravity auth errors
- Introduce `HTTPStatusError` to retain upstream HTTP status codes across Antigravity OAuth and project lookup calls.
- Propagate status codes and retry-after metadata from cause errors in `missingAntigravityProjectIDError`.

Closes: #5368
2026-09-01 08:37:02 +08:00
Luis Pater
f2e2d713b2 fix(auth): propagate upstream error causes in auth selection failures
- Attach candidate upstream errors as causes to scheduler availability and cooldown errors.
- Introduce `errorWithCause` wrapper to extract and display upstream error summaries.
- Enrich auth selection error messages with upstream details and preserve model cooldown errors.
- Forward `Retry-After` response headers for model cooldown errors in Claude Code handler.

Closes: #5365
2026-09-01 08:15:51 +08:00
Luis Pater
ff811577eb fix(auth): isolate subagent session affinity for antigravity and gemini
- Prevent subagent sessions from inheriting parent credentials on Antigravity and Gemini providers and models to mitigate concurrency rate limiting.
- Avoid aliasing subagent session keys to parent fallback keys or mutating parent bindings during subagent result handling.

Closes: #5364
2026-08-31 22:34:58 +08:00
Luis Pater
9721d9939e feat(usage): track streaming execution state in usage records
- Add `Stream` field to usage records, context helpers, and Redis queue payloads.
- Propagate streaming mode across execution handlers, conductors, and usage reporters.

Closes: #5361
2026-08-31 20:29:19 +08:00
sususu
5755d00b1b refactor(session): prune in-memory session tree store in favor of flat KV affinity and pure info extraction
- Replace complex materialized tree structures with lightweight (session_id, parent_id) extraction
- Maintain O(1) flat KV cache for subagent-to-parent prompt cache inheritance
- Add tree_compat.go with deprecated stubs to preserve SDK compatibility
- Add comprehensive regression tests for multi-protocol session headers and payloads
2026-08-31 20:28:15 +08:00
Luis Pater
9fdc460585 fix(claude): preserve tool pairing across intervening system messages
- Preserve pending tool use IDs across message-level system reminders to maintain tool call and result alignment.
- Merge adjacent Gemini request contents for consecutive user and system reminder turns.
- Relax tool response reordering condition and preserve non-response parts in Antigravity executor.
- Align tool results and buffer pending system reminders in OpenAI translator.

Closes: #5354
2026-08-31 19:27:20 +08:00
sususu
c99ce12123 fix(session): harden depth-cap index cleanup, bound lcp fingerprints, and support nested payloads (#5202) 2026-08-31 14:55:37 +08:00
sususu98
c2021cd2fe perf(test): eliminate physical sleeps and normalize mock timeouts in xai and home (#5328)
- Inject test-scoped minPollInterval into XAIAuth to avoid multi-second physical sleeps during device-flow polling tests
- Add TestXAIAuthDefaultPollInterval regression test to verify default production interval remains 5s
- Introduce testOperationTimeout to home Client so mock test clients consistently use short 50ms timeouts
- Fix malformed RESP bulk string length for GET config mock response in TestRunConfigSubscriberLifetimeRejectsInvalidSubscriptionACK
- Add TestDefaultProductionClientTimeouts regression test to verify default production timeouts are preserved
2026-08-31 14:32:24 +08:00
sususu
100c564313 fix(session): harden nil fallback, normalize agent id, and support nested antigravity payloads (#5202) 2026-08-31 14:00:10 +08:00
sususu
8211388946 feat(session): implement Merkle LCP session affinity, session tree, and distributed Home hierarchy (#5202)
- Implement Merkle Longest Common Prefix (LCP) session affinity engine across OpenAI, Claude, Gemini, Interactions, and Responses protocols in sdk/cliproxy/session/lcp.go
- Implement in-memory hierarchical session tree store with dynamic lineage recalculation, reparenting, cycle prevention, and parentIndex descendant cascading in sdk/cliproxy/session/tree.go
- Integrate Merkle prefix matching and hierarchical session tree into SessionAffinitySelector
- Bound SessionCache capacity to 65,536 entries with deterministic eviction
- Support Claude nested metadata parent extraction and Header+Body parent merging
- Enforce TTL expiration checks in touchLocked and bindLocked
- Propagate ParentSessionID in authDispatchRequest and RPopAuthWithSessionHierarchy for distributed Home dispatch
- Add isHierarchyParent in home_session_alias.go covering Claude, Codex, Pi slot, Antigravity, and Gemini caching
- Add comprehensive test suites in lcp_test.go, tree_test.go, selector_lcp_test.go, client_test.go, and home_session_alias_test.go
2026-08-31 11:18:41 +08:00
Luis Pater
81e1b5374f docs(readme): remove LMU sponsor
- Remove LMU sponsorship section and asset across README files.
2026-08-31 10:04:48 +08:00
Luis Pater
9654894c7e Merge pull request #5356 from router-for-me/store
fix(store): close git repos during recovery
2026-08-31 08:45:56 +08:00
hkfires
b908ed5d86 fix(store): close git repos during recovery
Close go-git repository handles across store operations and tests to avoid
leaked handles blocking recovery cleanup. Abort recovery before mutating the
worktree when close failures occur and retain backups when rollback fails.
2026-08-31 08:41:08 +08:00
Luis Pater
d31b15916d feat(executor): support token usage parsing for plugin executors
- Add `ParsePluginExecutorResponseUsage` to extract token usage from non-streaming plugin responses across Claude, Gemini, Interactions, Antigravity, and OpenAI/Codex protocols.
- Add `ObservePluginExecutorStreamUsage` to observe and aggregate token usage across streaming chunks.

Closes: #5340
v7.2.146
2026-08-30 14:51:08 +08:00