diff --git a/CHANGELOG.md b/CHANGELOG.md index 7315a1945b..d132b6ab81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### ✨ New Features -- **feat(api-keys):** add rename support in the permissions modal — editable key name field with validation +- **feat:** ongoing development --- @@ -13,6 +13,7 @@ ### ✨ New Features - **feat(tunnels):** integrate native ngrok tunnel support with dashboard UI parity (#1753) +- **feat(api-keys):** add rename support in the permissions modal — editable key name field with validation (#1796) ### 🐛 Bug Fixes @@ -21,6 +22,8 @@ - **fix(chatgpt-web):** restore validator + expand model catalog to ChatGPT Plus tier (#1792) - **fix(codex):** stabilize Copilot responses replay state (#1791) - **fix(antigravity):** cap Claude bridge output tokens (#1785) +- **fix(schema):** strip `default` properties from tool-call JSON schemas during egress to prevent injection errors (#1782) +- **fix(db):** add `quota_snapshots` table to core DB schema initialization to prevent startup failures on fresh installs - **fix(models):** apply blocked providers filter to non-chat catalog models (image, embedding, audio, etc.) (#1752) - **fix(antigravity):** stabilize streaming payload parsing and deduplicate usage/model metadata refreshes (#1748) - **fix(antigravity):** normalize Gemini bridge payloads — sanitize tool names, cap output tokens, and fix thinking budget (#1769) diff --git a/open-sse/translator/helpers/schemaCoercion.ts b/open-sse/translator/helpers/schemaCoercion.ts index ecce28a0a7..17030c1703 100644 --- a/open-sse/translator/helpers/schemaCoercion.ts +++ b/open-sse/translator/helpers/schemaCoercion.ts @@ -52,6 +52,11 @@ export function coerceSchemaNumericFields(schema: unknown): unknown { const result: JsonRecord = { ...schema }; + // Fix #1782: Strip 'default' property to prevent upstream models from eagerly injecting optional fields + if ("default" in result) { + delete result.default; + } + for (const field of NUMERIC_SCHEMA_FIELDS) { if (field in result) { result[field] = coerceNumericString(result[field]); diff --git a/src/lib/db/core.ts b/src/lib/db/core.ts index 4a0deee28d..bf2b55d879 100644 --- a/src/lib/db/core.ts +++ b/src/lib/db/core.ts @@ -345,6 +345,22 @@ const SCHEMA_SQL = ` ); CREATE INDEX IF NOT EXISTS idx_sc_sig ON semantic_cache(signature); CREATE INDEX IF NOT EXISTS idx_sc_model ON semantic_cache(model); + + CREATE TABLE IF NOT EXISTS quota_snapshots ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + provider TEXT NOT NULL, + connection_id TEXT NOT NULL, + window_key TEXT NOT NULL, + remaining_percentage REAL, + is_exhausted INTEGER DEFAULT 0, + next_reset_at TEXT, + window_duration_ms INTEGER, + raw_data TEXT, + created_at TEXT NOT NULL DEFAULT (datetime('now')) + ); + CREATE INDEX IF NOT EXISTS idx_quota_snapshots_provider_time ON quota_snapshots(provider, created_at); + CREATE INDEX IF NOT EXISTS idx_quota_snapshots_connection_time ON quota_snapshots(connection_id, created_at); + CREATE INDEX IF NOT EXISTS idx_quota_snapshots_created_at ON quota_snapshots(created_at); `; // ──────────────── Column Mapping ────────────────