fix(coding-agent/tools): ignore literal refs when scanning yield schemas

YieldTool's unresolved-ref fallback now skips literal-value positions such as const, enum, default, and examples when looking for unresolved schema refs. Valid schemas containing data literals like { "": "literal" } no longer degrade to the loose schema and still reject invalid yield payloads.
This commit is contained in:
can1357
2026-05-15 18:31:12 +02:00
parent 88e5e8a9a2
commit 03f09e7ee9
2 changed files with 22 additions and 0 deletions
+1
View File
@@ -63,6 +63,7 @@ function hasUnresolvedRefs(schema: unknown): boolean {
const record = schema as Record<string, unknown>;
if (typeof record.$ref === "string") return true;
for (const key in record) {
if (key === "const" || key === "default" || key === "enum" || key === "examples") continue;
if (hasUnresolvedRefs(record[key])) return true;
}
return false;