mirror of
https://github.com/dtzp555-max/ocp.git
synced 2026-07-22 13:35:08 +00:00
fix(structured): narrow validateJsonSchemaSafe to RangeError-only + drop unused import (review fold-in)
Reviewer of #184: the catch-all would silently mask a future genuine bug (e.g. a TypeError from a malformed schema) as a validation miss. Narrowed to `if (e instanceof RangeError) return [...]; throw e;` so only the #181 deep-nesting overflow becomes a refusal; any other throw surfaces at error level as before. +1 test proving a non-RangeError (required:42 → TypeError) re-throws. Dropped the now- unused raw `validateJsonSchema` import from server.mjs. Merged current main (incl. #183) so CI runs the true post-merge tree. Suite 433/0. Co-Authored-By: Claude <claude-opus-4-8> <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude <claude-opus-4-8> <noreply@anthropic.com>
parent
2ad8a5245d
commit
9df622c7f8
+1
-1
@@ -42,7 +42,7 @@ import { dirname, join } from "node:path";
|
||||
import { homedir } from "node:os";
|
||||
import { validateKey, recordUsage, getUsageByKey, getUsageTimeline, getRecentUsage, createKey, listKeys, revokeKey, closeDb, checkQuota, updateKeyQuota, getKeyQuota, findKey, cacheHash, getCachedResponse, setCachedResponse, clearCache, getCacheStats, hasCacheControl, singleflight, getInflightStats } from "./keys.mjs";
|
||||
import { DEFAULT_PORT } from "./lib/constants.mjs";
|
||||
import { StructuredOutputError, detectStructuredOutput, validateJsonSchema, validateJsonSchemaSafe, extractJsonPayload, structuredSystemInstruction, resolveMaxAttempts } from "./lib/structured-output.mjs";
|
||||
import { StructuredOutputError, detectStructuredOutput, validateJsonSchemaSafe, extractJsonPayload, structuredSystemInstruction, resolveMaxAttempts } from "./lib/structured-output.mjs";
|
||||
import { isLoopbackBind } from "./lib/net.mjs";
|
||||
import { runTuiTurn, reapStaleTuiSessions, resolveTuiHome, bootTuiPane, tuiPaneHealthy, poolPaneName, POOL_BOOT_MS } from "./lib/tui/session.mjs";
|
||||
import { detectTuiUpstreamError } from "./lib/tui/transcript.mjs";
|
||||
|
||||
Reference in New Issue
Block a user