Skip to content

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

Open
Ayush7614 wants to merge 1 commit into
CopilotKit:mainfrom
Ayush7614:fix/sandbox-template-json-guard
Open

fix(server): report a sandbox template that is not valid JSON as a SandboxError#391
Ayush7614 wants to merge 1 commit 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.

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.

1 participant