[codex] fix cross-database JSON boundary handling (#283)

* fix: normalize cross-database json boundaries

* fix: address json boundary review comments

---------

Co-authored-by: apple <apple@appledeMacBook-Pro.local>
This commit is contained in:
Cita
2026-03-26 20:21:19 +08:00
committed by GitHub
parent 7e1fb8eb1b
commit b3387dfba7
30 changed files with 1134 additions and 97 deletions
@@ -7,7 +7,8 @@ function serializeSnapshot(snapshot: unknown): string | null {
return JSON.stringify(snapshot);
}
export function parseRouteDecisionSnapshot(value: string | null | undefined): unknown | null {
export function parseRouteDecisionSnapshot(value: unknown): unknown | null {
if (value && typeof value === 'object') return value;
if (typeof value !== 'string' || value.trim().length === 0) return null;
try {
return JSON.parse(value);