moeru-ai/airi · error · Error
Invalid Godot stage scene input payload.
Error message
Invalid Godot stage scene input payload.
What it means
Thrown by parseSceneInputPayload when valibot's safeParse against godotStageSceneInputPayloadSchema fails. The schema validates the shape of a scene-input payload (fileName, modelId, data, etc.) forwarded to the Godot stage. safeParse returns { success: false } for any structural/type violation, so the throw is purely a validation failure on the inbound IPC payload.
Source
Thrown at apps/stage-tamagotchi/src/main/services/airi/godot-stage/index.ts:230
if (!result.success)
throw new Error('Invalid Godot stage WebSocket envelope.')
return result.output
}
function getPayloadMessage(payload: unknown) {
const result = safeParse(godotStagePayloadMessageSchema, payload)
if (!result.success) {
return undefined
}
return result.output.message
}
function parseSceneInputPayload(payload: unknown): ElectronGodotStageSceneInputPayload {
const result = safeParse(godotStageSceneInputPayloadSchema, payload)
if (!result.success)
throw new Error('Invalid Godot stage scene input payload.')
return result.output
}
function resolveGodotStageStorageRoot() {
return join(app.getPath('userData'), 'godot-stage')
}
function resolveGodotStageDebugLaunchOptions() {
const remoteDebugEnabled = ['1', 'true', 'yes', 'on'].includes(
(process.env.GODOT_STAGE_REMOTE_DEBUG ?? '').trim().toLowerCase(),
)
const remoteDebugUri = remoteDebugEnabled
? process.env.GODOT_STAGE_REMOTE_DEBUG_URI?.trim() || DEFAULT_GODOT_REMOTE_DEBUG_URI
: undefined
// Godot engine/debugger flags must stay before `--`; StageRoot arguments stay
// after it and are assembled next to the WebSocket URL.View on GitHub (pinned to 27111382b4)
Solutions
- Compare the payload object against godotStageSceneInputPayloadSchema (in @proj-airi/stage-shared/godot-stage) and supply every required field with the correct type.
- Validate on the caller side with the same schema before invoking applySceneInput so the error surfaces at the source.
- Ensure binary data is sent as a Uint8Array/Buffer that survives IPC serialization.
- If the schema changed, rebuild and re-check both renderer and main against the latest shared package.
Example fix
// before
await electronGodotStageApplySceneInput({ fileName: 'model.vrm' }) // missing modelId/data
// after
await electronGodotStageApplySceneInput({
modelId: 'abc-123',
fileName: 'model.vrm',
data: new Uint8Array(fileBytes),
}) Defensive patterns
Strategy: validation
Validate before calling
import { safeParse, godotStageSceneInputPayloadSchema } from '@proj-airi/stage-shared/godot-stage'
const result = safeParse(godotStageSceneInputPayloadSchema, payload)
if (!result.success) {
// surface result.issues to the caller; do not invoke applySceneInput
} Type guard
import { safeParse, godotStageSceneInputPayloadSchema } from '@proj-airi/stage-shared/godot-stage'
function isValidSceneInputPayload(payload: unknown): boolean {
return safeParse(godotStageSceneInputPayloadSchema, payload).success
} Prevention
- Validate payloads with the shared schema at the call site before IPC.
- Keep renderer and main on the same version of the shared schema package.
- Send binary data as Uint8Array so it survives IPC serialization.
When it happens
Trigger: Calling electronGodotStageApplySceneInput with a payload missing required fields, with wrong-typed fields (e.g. data not a Uint8Array/Buffer-compatible value, fileName not a string), or with extra fields that the schema rejects.
Common situations: Renderer/IPC caller constructed the payload by hand and omitted a required field; schema was tightened in a shared package but the caller wasn't updated; deserialization (IPC) coerced a Buffer into a plain object; modelId empty or fileName containing path traversal characters that the schema forbids.
Related errors
- Godot stage is not running.
- Godot stage bridge is not connected.
- componentName is required to spawn a widget.
- id is required to update a widget.
- id is required to remove a widget.
AI-assisted analysis of moeru-ai/airi@27111382b4 (2026-08-12).
Data as JSON: /api/errors/f1057114a092f093.
Report an issue: GitHub.