{"record":{"id":"1be0586fa833f20a","repo":"garrytan/gstack","slug":"unknown-meta-command-command","errorCode":null,"errorMessage":"Unknown meta command: ${command}","messagePattern":"Unknown meta command: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"browse/src/meta-commands.ts","lineNumber":1172,"sourceCode":"      return await handleSkillCommand(args, { port });\n    }\n\n    case 'cdp': {\n      // Lazy import — cdp-bridge introduces module deps we don't want loaded\n      // for projects that never use the CDP escape hatch.\n      const { handleCdpCommand } = await import('./cdp-commands');\n      return await handleCdpCommand(args, bm);\n    }\n\n    case 'memory': {\n      // Lazy import — pulls in cdp-bridge + memory-snapshot + buffer accessors\n      // that aren't useful for projects that never run the diagnostic.\n      const { handleMemoryCommand } = await import('./memory-command');\n      return await handleMemoryCommand(args, bm);\n    }\n\n    default:\n      throw new Error(`Unknown meta command: ${command}`);\n  }\n}\n","sourceCodeStart":1154,"sourceCodeEnd":1175,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/meta-commands.ts#L1154-L1175","documentation":"The `default` branch of the meta-command switch (line 1172). It fires when `handleMetaCommand` is called with a `command` that has no matching `case` — i.e. a string the dispatcher doesn't recognize as a meta command. This usually means the command belongs in `READ_COMMANDS`/`WRITE_COMMANDS` instead, was misrouted, or is a typo.","triggerScenarios":"Calling `handleMetaCommand('xyz', ...)` with an unrecognized command name, or a routing layer that forwards non-meta commands into the meta handler.","commonSituations":"A new command not yet added as a `case`; a rename where callers still use the old name; misrouting by a dispatcher that should have sent the command to read/write handlers.","solutions":["Confirm the command is actually a meta command (check the `case` labels in handleMetaCommand).","If it's a read/write command, route it through `handleReadCommand`/`handleWriteCommand` instead.","If it's genuinely new, add a `case` for it (and register it in `META_COMMANDS`).","Check for typos or stale references after a rename."],"exampleFix":"// before\nawait handleMetaCommand('snapsot', args, bm, shutdown, tokenInfo, opts); // typo\n// after\nawait handleMetaCommand('snapshot', args, bm, shutdown, tokenInfo, opts);","handlingStrategy":"validation","validationCode":"const META = new Set(['screenshot', 'pdf', 'chain', 'diff', 'state', 'frame', 'ux-audit', 'domain-skill', 'skill', 'cdp', 'memory' /* ... */]);\nif (!META.has(command)) {\n  throw new Error(`Not a meta command: '${command}'. Route through read/write handlers or add a case.`);\n}","typeGuard":"const isMetaCommand = (s: string): boolean =>\n  META_COMMANDS.has(s);","tryCatchPattern":null,"preventionTips":["Validate the command against `META_COMMANDS` before calling `handleMetaCommand`.","After renames, keep an alias map and canonicalize before dispatch.","Add a lint/test that every registered command has a handler in exactly one of the three registries."],"tags":["meta-command","dispatch","unknown-command"],"backgroundTag":null,"analyzedSha":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}