feat: sync deployed v1.0.0-rc.38-custom.42

Sync production source including routing, billing, Astra detection and public uptime. Update custom build instructions and license packaging.
This commit is contained in:
cneicy committed 2026-09-26 04:49:11 +08:00
1 parent aa6c3f50f4
commit ceddfd3d6b
828 files changed
+122253 -13702

No files matched your search

+24 -33
View File
@@ -155,32 +155,33 @@ func TestPreflightRoutingConflict(t *testing.T) {
routingProtocolExport("openai_responses"))
protocolRegistry := NewRegistry()
require.NoError(t, protocolRegistry.ReplaceOverrides([]*LoadedPlugin{left}))
protocolErr := PreflightRoutingConflict(protocolRegistry.Generation(), right)
require.Error(t, protocolErr)
assert.Contains(t, protocolErr.Error(), "preflight-left")
assert.Contains(t, protocolErr.Error(), `model "shared-model" conflicts`)
require.NoError(t, PreflightRoutingConflict(protocolRegistry.Generation(), right))
}
func TestPerProtocolModelsStillConflictOnOverlap(t *testing.T) {
registry := NewRegistry()
first := mustCompileRoutingPlugin(t, "overlap-first", 0, `["shared-model"]`,
`protocols: [{name: "openai_responses", models: ["shared-model"], supports: ["stream", "sync", "background"]}],`,
routingProtocolExport("openai_responses"))
second := mustCompileRoutingPlugin(t, "overlap-second", 0, `["shared-model"]`,
`protocols: [{name: "openai_responses", models: ["shared-model"], supports: ["stream", "sync", "background"]}],`,
routingProtocolExport("openai_responses"))
require.NoError(t, registry.ReplaceOverrides([]*LoadedPlugin{first, second}))
routingErrors := registry.RoutingErrors()
require.Len(t, routingErrors, 1, "one of two overlapping claims must be rejected from the generation")
for _, message := range routingErrors {
assert.Contains(t, message, "conflicts")
func TestPerProtocolModelsAcceptSharedPluginClaims(t *testing.T) {
for _, channelType := range []int{0, 24} {
t.Run(fmt.Sprintf("first_channel_type_%d", channelType), func(t *testing.T) {
registry := NewRegistry()
first := mustCompileRoutingPlugin(t, "overlap-first", channelType, `["shared-model"]`,
`protocols: [{name: "openai_responses", models: ["shared-model"], supports: ["stream", "sync", "background"]}],`, routingProtocolExport("openai_responses"))
second := mustCompileRoutingPlugin(t, "overlap-second", 0, `["shared-model"]`,
`protocols: [{name: "openai_responses", models: ["shared-model"], supports: ["stream", "sync", "background"]}],`, routingProtocolExport("openai_responses"))
require.NoError(t, registry.ReplaceOverrides([]*LoadedPlugin{second, first}))
assert.Empty(t, registry.RoutingErrors())
generation := registry.Generation()
candidates := generation.LookupEndpointCandidates("POST", "/v1/responses", "shared-model")
require.Len(t, candidates, 2)
assert.Same(t, first, candidates[0].Plugin)
assert.Same(t, second, candidates[1].Plugin)
assert.Equal(t, []*LoadedPlugin{first, second}, generation.PluginsByModel("shared-model"))
metadata, ok := generation.GetByModel("shared-model")
require.True(t, ok)
assert.Same(t, first, metadata)
copy := generation.PluginsByModel("shared-model")
copy[0] = nil
assert.Same(t, first, generation.PluginsByModel("shared-model")[0])
})
}
binding, ok := registry.Generation().LookupEndpoint("POST", "/v1/responses", "shared-model")
require.True(t, ok)
candidates := registry.Generation().LookupEndpointCandidates("POST", "/v1/responses", "shared-model")
assert.Len(t, candidates, 1)
assert.NotNil(t, binding.Plugin)
}
func TestProtocolClaimDecodeAndValidation(t *testing.T) {
@@ -497,16 +498,6 @@ func TestRegistryExcludesConflictingPluginWithoutBlockingGeneration(t *testing.T
`export const native = {status: function(ctx, task) { return task; }};`),
expectedError: "route GET /vendor/jobs/:id conflicts",
},
{
name: "endpoint model ownership",
first: mustCompileRoutingPlugin(t, "endpoint-alpha", 0, `["shared-model"]`,
`protocols: [{name: "openai_responses", supports: ["stream", "sync", "background"]}],`,
routingProtocolExport("openai_responses")),
second: mustCompileRoutingPlugin(t, "endpoint-beta", 0, `["shared-model"]`,
`protocols: [{name: "openai_responses", supports: ["stream", "sync", "background"]}],`,
routingProtocolExport("openai_responses")),
expectedError: `model "shared-model" conflicts`,
},
}
for _, testCase := range tests {