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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user