Skip to content

fix(server): report a sandbox template that is not valid JSON as a SandboxError - #391

Merged
davidmckayv merged 3 commits into
CopilotKit:mainfrom
Ayush7614:fix/sandbox-template-json-guard
Sep 6, 2026
Merged

fix(server): report a sandbox template that is not valid JSON as a SandboxError#391
davidmckayv merged 3 commits into
CopilotKit:mainfrom
Ayush7614:fix/sandbox-template-json-guard

Conversation

@Ayush7614

Copy link
Copy Markdown
Contributor

readSandboxTemplate guarded the file read but not the parse: malformed JSON threw a bare SyntaxError and null/array JSON threw a TypeError on .podTemplate, bypassing the SandboxError handling the boot path expects for deployment misconfiguration.

Wraps JSON.parse and adds an object/null/array shape check so every bad template surfaces as SandboxError. Verified with a file-based script (malformed, null, array, missing podTemplate, valid) and all 8 existing computer-sandbox tests plus server typecheck green.

@davidmckayv davidmckayv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep-reviewed against live code (correctness, governance, no vendor/secret/scale issues). Composed build+tests green. CHANGELOG/format rebase on CI-validated substance.

@davidmckayv
davidmckayv merged commit 8290aeb into CopilotKit:main Sep 6, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants