{"record":{"id":"25de19f74c67e755","repo":"CopilotKit/CopilotKit","slug":"unknown-message-in-metaevents-copilot-resolver","errorCode":null,"errorMessage":"Unknown message in metaEvents copilot resolver","messagePattern":"Unknown message in metaEvents copilot resolver","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/runtime/src/v1-deprecated/graphql/resolvers/copilot.resolver.ts","lineNumber":355,"sourceCode":"                        ) {\n                          return plainToInstance(TextMessage, {\n                            id: message.id,\n                            createdAt: new Date(),\n                            content: [(message as TextMessage).content],\n                            role: (message as TextMessage).role,\n                            status: new SuccessMessageStatus(),\n                          });\n                        }\n                        if (\"arguments\" in message) {\n                          return plainToInstance(ActionExecutionMessage, {\n                            name: message.name,\n                            id: message.id,\n                            arguments: [JSON.stringify(message.arguments)],\n                            createdAt: new Date(),\n                            status: new SuccessMessageStatus(),\n                          });\n                        }\n                        throw new Error(\n                          \"Unknown message in metaEvents copilot resolver\",\n                        );\n                      }),\n                    },\n                  }),\n                );\n                break;\n            }\n          },\n          error: (err) => {\n            // For structured CopilotKit errors, set proper error response status\n            if (\n              err?.name?.includes(\"CopilotKit\") ||\n              err?.extensions?.visibility\n            ) {\n              responseStatus$.next(\n                new UnknownErrorResponse({\n                  description: err.message || \"Agent error occurred\",","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/CopilotKit/CopilotKit/blob/68fbe97d87420bd84e8196965c71bd6e394a3f7a/packages/runtime/src/v1-deprecated/graphql/resolvers/copilot.resolver.ts#L337-L373","documentation":"While streaming meta events in the generateCopilotResponse resolver, an event message of an unrecognized type reaches the dispatch chain and falls through all known cases, throwing this internal invariant error.","triggerScenarios":"A new or unexpected message type inside metaEvents during response streaming — usually version skew between emitted event payloads and the resolver's switch, or a malformed injected event.","commonSituations":"Mixing runtime package versions after a partial upgrade; custom code injecting extra messages into the event stream; bugs in the deprecated v1 resolver.","solutions":["Align all @copilotkit/* packages to the same version (clean reinstall of node_modules)","Remove custom code that injects non-standard messages into metaEvents","Reproduce with a minimal agent and report/upgrade — this is an internal invariant, not a config knob"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { for await (const evt of stream) { /* ... */ } } catch (e) { if (e instanceof Error && e.message.includes(\"metaEvents copilot resolver\")) { logger.error(\"runtime version skew suspected\", e); } throw e; }","preventionTips":["Keep all @copilotkit/* packages on identical versions","Avoid injecting custom messages into internal event streams"],"tags":["graphql","event-stream","internal"],"backgroundTag":"unsupported-message-type","analyzedSha":"68fbe97d87420bd84e8196965c71bd6e394a3f7a","analyzedAt":"2026-08-27T04:03:26.537Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}