Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7a0b756
feat(signature): recognize Meta Muse reasoning envelopes and gate rep…
sususu98 Oct 15, 2026
88ac14f
fix(translator): carry reasoning thought signatures through Gemini pr…
sususu98 Oct 16, 2026
a466026
fix(signature): make Gemini thought-signature carriage SDK-safe and o…
sususu98 Oct 16, 2026
cc5682c
fix(signature): replay OpenRouter router-suffixed Meta Muse signatures
sususu98 Oct 16, 2026
772df04
feat(translator): relay reasoning signatures through the Interactions…
sususu98 Oct 16, 2026
674dbe8
fix(signature): support Meta Muse signatures across third-party Respo…
sususu98 Oct 16, 2026
be9fbd9
feat(signature): support router-suffixed GPT/Grok envelopes and multi…
sususu98 Oct 16, 2026
a68c7d8
fix(signature): strip OpenRouter private RouterSuffix on official and…
sususu98 Oct 16, 2026
4337f1f
fix(logging): escape request path in access log to prevent log injection
luispater Oct 18, 2026
29076c9
Merge pull request #6738 from sususu98/feat/meta-muse-signature-replay
sususu98 Oct 18, 2026
c558d32
feat(util): inline local schema references in Gemini cleaners and pre…
luispater Oct 18, 2026
d69962e
feat(management): add safe Modify method for auth records with epoch …
luispater Oct 18, 2026
7484a52
feat(watcher): protect credentials from unindexed deletion during inc…
luispater Oct 18, 2026
50cfd23
feat(management): add support for static and plugin model definitions…
luispater Oct 18, 2026
5de9de9
perf(gemini): pin request payload and resolved tool maps per stream i…
luispater Oct 18, 2026
feb6398
feat(auth): increase Codex proactive refresh lead to 96 hours and imp…
luispater Oct 18, 2026
1ad175b
feat(auth): snapshot plugin scheduler and release host lock during ex…
luispater Oct 18, 2026
904ec71
feat(auth): enable expired antigravity AI credits negative hint recov…
luispater Oct 18, 2026
030d17e
perf(openai): cache stream preferences and tool maps per stream in Cl…
luispater Oct 19, 2026
9d453bc
feat(cache): add Claude web search result caching and restoration for…
luispater Oct 19, 2026
07feedf
fix(api): allow empty home model catalog
hkfires Oct 19, 2026
4d34502
fix(api): reject home models error envelopes
hkfires Oct 19, 2026
3bbd165
Merge pull request #6765 from router-for-me/models
luispater Oct 19, 2026
d9451cb
feat(vertex): support partner and open models via endpoints/openapi r…
luispater Oct 19, 2026
084b9ca
feat(claude): strip Claude Code identity on API keys with cloak mode …
luispater Oct 19, 2026
45ccd9c
fix(openai): preserve model prefix when routing xAI image requests
luispater Oct 19, 2026
8df4e42
fix(codex): advertise direct tool mode and disable responses lite for…
luispater Oct 19, 2026
e7d4c73
fix(codex): reconcile replayed web_search_call history with tool decl…
luispater Oct 19, 2026
edb9526
chore: sync CLIProxyAPI v8.0.34
awsldev Oct 19, 2026
9adb32e
fix(sdk): use v8 imports in executor wrappers
awsldev Oct 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions cmd/fetch_codex_models/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,19 @@ func ensureBaselineModel(raw []byte) ([]byte, int, error) {
return nil, 0, fmt.Errorf("failed to set %s visibility on cloned model: %w", baselineModelSlug, errSet)
}
}
for _, reset := range []struct {
path string
value any
}{
{path: "tool_mode", value: "direct"},
{path: "use_responses_lite", value: false},
{path: "supports_reasoning_effort_updates", value: false},
} {
cloned, errSet = sjson.SetBytes(cloned, reset.path, reset.value)
if errSet != nil {
return nil, 0, fmt.Errorf("failed to set %s %s on cloned model: %w", baselineModelSlug, reset.path, errSet)
}
}
raw, errSet = sjson.SetRawBytes(raw, "models.-1", cloned)
if errSet != nil {
return nil, 0, fmt.Errorf("failed to append %s model: %w", baselineModelSlug, errSet)
Expand Down
14 changes: 13 additions & 1 deletion cmd/fetch_codex_models/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestCountModels(t *testing.T) {

func TestEnsureBaselineModel(t *testing.T) {
t.Run("clones first model as gpt-5.5 when missing", func(t *testing.T) {
raw := []byte(`{"models":[{"slug":"gpt-6.1-sol","display_name":"GPT-6.1-Sol","visibility":"list"},{"slug":"gpt-5.6-sol","visibility":"list"}]}`)
raw := []byte(`{"models":[{"slug":"gpt-6.1-sol","display_name":"GPT-6.1-Sol","visibility":"list","tool_mode":"code_mode_only","use_responses_lite":true,"supports_reasoning_effort_updates":true},{"slug":"gpt-5.6-sol","visibility":"list"}]}`)
out, count, errEnsure := ensureBaselineModel(raw)
if errEnsure != nil {
t.Fatalf("ensureBaselineModel: %v", errEnsure)
Expand All @@ -64,6 +64,9 @@ func TestEnsureBaselineModel(t *testing.T) {
if got := gjson.GetBytes(out, "models.0.slug").String(); got != "gpt-6.1-sol" {
t.Fatalf("models[0].slug = %q, want gpt-6.1-sol", got)
}
if got := gjson.GetBytes(out, "models.0.tool_mode").String(); got != "code_mode_only" {
t.Fatalf("models[0].tool_mode = %q, want code_mode_only", got)
}
if got := gjson.GetBytes(out, "models.2.slug").String(); got != "gpt-5.5" {
t.Fatalf("models[2].slug = %q, want gpt-5.5", got)
}
Expand All @@ -73,6 +76,15 @@ func TestEnsureBaselineModel(t *testing.T) {
if got := gjson.GetBytes(out, "models.2.visibility").String(); got != "list" {
t.Fatalf("models[2].visibility = %q, want list", got)
}
if got := gjson.GetBytes(out, "models.2.tool_mode"); got.Type != gjson.String || got.Str != "direct" {
t.Fatalf("models[2].tool_mode = %v (%s), want string \"direct\"", got.Value(), got.Type)
}
if got := gjson.GetBytes(out, "models.2.use_responses_lite"); got.Type != gjson.False {
t.Fatalf("models[2].use_responses_lite = %v (%s), want false", got.Value(), got.Type)
}
if got := gjson.GetBytes(out, "models.2.supports_reasoning_effort_updates"); got.Type != gjson.False {
t.Fatalf("models[2].supports_reasoning_effort_updates = %v (%s), want false", got.Value(), got.Type)
}
})

t.Run("clones first model and forces visibility to list when first model is hidden", func(t *testing.T) {
Expand Down
8 changes: 7 additions & 1 deletion config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ client:
# Default false. Applies to both OAuth and API-key credentials across providers.
# Legacy provider paths migrate here; this path wins conflicts, including explicit false.
optimize-multi-agent-v2: false
# Cache upstream web search results per session so replayed Codex web_search_call items
# that omit results still retain search results in later turns.
web-search-result-cache:
enabled: false
ttl: "24h"
limit: 1024

# Shared upstream behavior applies to OAuth and API-key credentials.
upstream:
Expand Down Expand Up @@ -722,7 +728,7 @@ upstream:
# cloak: # optional: explicitly enable request cloaking for non-Claude-Code clients
# mode: "auto" # "auto" (default inside this block): cloak only when client is not Claude Code
# # "always": cloak every unconfirmed client; confirmed native Claude Code still passes through
# # "never": never apply cloaking
# # "never" / "uncloak": never apply cloaking; on non-CLI API keys, also strip incoming Claude Code identity/billing attribution
# # This "cloak" block applies to this api-keys.claude key entry only. For Claude OAuth
# # credentials, set the same options in the auth/token JSON file via "cloak_mode" /
# # "cloak_strict_mode" / "cloak_sensitive_words" / "cloak_cache_user_id".
Expand Down
118 changes: 65 additions & 53 deletions internal/api/handlers/management/auth_files_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,21 @@ func (h *Handler) PatchAuthFileStatus(c *gin.Context) {
return
}

applyAuthDisabledState(targetAuth, *req.Disabled)
updatedAuth, err := h.authManager.Update(ctx, targetAuth)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to update auth: %v", err)})
updatedAuth, committed, errModify := h.authManager.Modify(ctx, targetAuth.ID, targetAuth.RegistrationEpoch, func(current *coreauth.Auth) error {
applyAuthDisabledState(current, *req.Disabled)
return nil
})
if errModify != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to update auth: %v", errModify)})
return
}
hookAuth := updatedAuth
if hookAuth == nil {
hookAuth = targetAuth
if !committed || updatedAuth == nil {
c.JSON(http.StatusNotFound, gin.H{"error": "auth file not found"})
return
}
locked = false
h.authStatusMu.Unlock()
if errHook := h.invokePostAuthPersistHooks(ctx, []*coreauth.Auth{hookAuth}); errHook != nil {
if errHook := h.invokePostAuthPersistHooks(ctx, []*coreauth.Auth{updatedAuth}); errHook != nil {
log.Errorf("post-auth persist hook failed for status update on %s: %v", targetAuth.ID, errHook)
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to synchronize auth runtime: %v", errHook)})
return
Expand Down Expand Up @@ -176,17 +178,18 @@ func (h *Handler) patchPluginVirtualSourceStatus(ctx context.Context, targetAuth
!sameAuthFilePath(authAttribute(auth, coreauth.AttributeVirtualSource), sourcePath) {
continue
}
applyAuthDisabledState(auth, disabled)
auth.UpdatedAt = now
updated, errUpdate := h.authManager.Update(ctx, auth)
updated, committed, errUpdate := h.authManager.Modify(ctx, auth.ID, auth.RegistrationEpoch, func(current *coreauth.Auth) error {
applyAuthDisabledState(current, disabled)
current.UpdatedAt = now
return nil
})
if errUpdate != nil {
return nil, fmt.Errorf("failed to update auth %s: %w", auth.ID, errUpdate)
}
hookAuth := updated
if hookAuth == nil {
hookAuth = auth
if !committed || updated == nil {
continue
}
hookAuths = append(hookAuths, hookAuth)
hookAuths = append(hookAuths, updated)
}
return hookAuths, nil
}
Expand Down Expand Up @@ -328,25 +331,58 @@ func (h *Handler) PatchAuthFileFields(c *gin.Context) {
c.JSON(http.StatusConflict, gin.H{"error": errPluginVirtualAuth.Error()})
return
}

updatedAuth, committed, errModify := h.authManager.Modify(ctx, targetAuth.ID, targetAuth.RegistrationEpoch, func(current *coreauth.Auth) error {
return applyAuthFileFieldsPatch(current, req, requestRetryPatch)
})
if errModify != nil {
var patchErr *authFileFieldPatchError
if errors.As(errModify, &patchErr) {
c.JSON(http.StatusBadRequest, gin.H{"error": patchErr.message})
return
}
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to update auth: %v", errModify)})
return
}
if !committed || updatedAuth == nil {
c.JSON(http.StatusNotFound, gin.H{"error": "auth file not found"})
return
}
if h.postAuthPersistHook != nil {
if errHook := h.postAuthPersistHook(ctx, updatedAuth); errHook != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("post-auth persist hook failed: %v", errHook)})
return
}
}

c.JSON(http.StatusOK, gin.H{"status": "ok"})
}

type authFileFieldPatchError struct {
message string
}

func (e *authFileFieldPatchError) Error() string {
return e.message
}

func applyAuthFileFieldsPatch(targetAuth *coreauth.Auth, req map[string]json.RawMessage, requestRetryPatch authFileRequestRetryPatch) error {
coreauth.NormalizeCredentialMetadata(targetAuth.Metadata)

changed := false
touchedRoots := make(map[string]struct{}, len(req))
for key, rawValue := range req {
fieldPath := strings.TrimSpace(key)
if fieldPath == "" {
c.JSON(http.StatusBadRequest, gin.H{"error": "field name is required"})
return
return &authFileFieldPatchError{message: "field name is required"}
}
value, errDecode := decodeAuthFileFieldValue(rawValue)
if errDecode != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": fmt.Sprintf("invalid field %s", fieldPath)})
return
return &authFileFieldPatchError{message: fmt.Sprintf("invalid field %s", fieldPath)}
}
if rootAuthFileField(fieldPath) == "excluded_models" {
if fieldPath != "excluded_models" {
c.JSON(http.StatusBadRequest, gin.H{"error": "excluded_models does not support nested fields"})
return
return &authFileFieldPatchError{message: "excluded_models does not support nested fields"}
}
if value != nil {
models, okModels := value.([]any)
Expand All @@ -358,8 +394,7 @@ func (h *Handler) PatchAuthFileFields(c *gin.Context) {
}
}
if !validModels {
c.JSON(http.StatusBadRequest, gin.H{"error": "excluded_models must be a string array or null"})
return
return &authFileFieldPatchError{message: "excluded_models must be a string array or null"}
}
}
}
Expand All @@ -372,24 +407,20 @@ func (h *Handler) PatchAuthFileFields(c *gin.Context) {
delete(targetAuth.Metadata, coreauth.AttributeWeight)
} else {
if _, okNumber := value.(json.Number); !okNumber {
c.JSON(http.StatusBadRequest, gin.H{"error": "weight must be an integer"})
return
return &authFileFieldPatchError{message: "weight must be an integer"}
}
weight, errWeight := credentialweight.ParseValue(value)
if errWeight != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": errWeight.Error()})
return
return &authFileFieldPatchError{message: errWeight.Error()}
}
targetAuth.Metadata[coreauth.AttributeWeight] = weight
}
} else if rootAuthFileField(fieldPath) == coreauth.AttributeWeight {
c.JSON(http.StatusBadRequest, gin.H{"error": "weight does not support nested fields"})
return
return &authFileFieldPatchError{message: "weight does not support nested fields"}
} else if fieldPath == "headers" {
applyAuthFileHeadersPatch(targetAuth, value)
} else if errSet := setAuthFileMetadataValue(targetAuth.Metadata, fieldPath, value); errSet != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": errSet.Error()})
return
return &authFileFieldPatchError{message: errSet.Error()}
}
if root := rootAuthFileField(fieldPath); root != "" {
touchedRoots[root] = struct{}{}
Expand All @@ -412,8 +443,7 @@ func (h *Handler) PatchAuthFileFields(c *gin.Context) {
if _, touched := touchedRoots["excluded_models"]; touched {
excluded, errExcluded := synthesizer.ExtractExcludedModelsFromMetadata(targetAuth.Metadata)
if errExcluded != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": errExcluded.Error()})
return
return &authFileFieldPatchError{message: errExcluded.Error()}
}
// ApplyAuthExcludedModelsMeta never clears attributes, so drop stale values first.
delete(targetAuth.Attributes, "excluded_models")
Expand All @@ -425,29 +455,11 @@ func (h *Handler) PatchAuthFileFields(c *gin.Context) {
}

if !changed {
c.JSON(http.StatusBadRequest, gin.H{"error": "no fields to update"})
return
return &authFileFieldPatchError{message: "no fields to update"}
}

targetAuth.UpdatedAt = time.Now()

updatedAuth, err := h.authManager.Update(ctx, targetAuth)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to update auth: %v", err)})
return
}
if h.postAuthPersistHook != nil {
hookAuth := updatedAuth
if hookAuth == nil {
hookAuth = targetAuth
}
if errHook := h.postAuthPersistHook(ctx, hookAuth); errHook != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("post-auth persist hook failed: %v", errHook)})
return
}
}

c.JSON(http.StatusOK, gin.H{"status": "ok"})
return nil
}

func decodeAuthFileFieldValue(raw json.RawMessage) (any, error) {
Expand Down
Loading
Loading