Removes the private isRecord function in apps/apollo/src/lib/sandbox/sandboxManager.ts (~line 178) and imports the equivalent from apps/apollo/src/common/utils/type-utils.ts instead (the shared isRecord already exists there and is used across apollo).
The shared version uses Zod's z.record(z.unknown()).safeParse(). For the values this guard actually sees this is behavior-preserving: the only call site, parseE2BSandboxApiResponse, is fed the result of await res.json(), so the input is always plain JSON (objects, arrays, primitives, null). Both implementations agree on all of those: they accept plain objects and reject null, arrays, and non-object types.
Note: the two implementations are NOT identical for exotic in-memory values. The removed manual check (typeof === 'object' && !== null && !Array.isArray) returns true for Date/Map/Set, whereas the shared Zod version returns false for those. Those types can never appear in a JSON-parsed payload, so this divergence is unreachable at the sandbox call site and there is no behavior change in practice.
Also adds apps/apollo/src/common/utils/type-utils.test.ts covering isRecord: true for plain objects (empty, primitive values, nested, array-valued), false for null/arrays/primitives/undefined/function.
parseE2BSandboxApiResponse only receives res.json() output, which JSON.parse restricts to objects/arrays/primitives/null — never Date/Map/Set — so the manual-vs-Zod divergence on those types cannot be hit.@/src/common/utils/type-utils matches the alias convention already used by other apollo files, and that the import sits in correct alphabetical order in the import block.isRecord is the single remaining usage in sandboxManager.ts (no half-removed local copy left).🤖 Generated with Claude Code