{"record":{"id":"8d9b8da6d4ebabfa","repo":"wavetermdev/waveterm","slug":"unsupported-command-type-q","errorCode":null,"errorMessage":"unsupported command type %q","messagePattern":"unsupported command type %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wshutil/wshadapter.go","lineNumber":173,"sourceCode":"\t\t\t\tdefer handler.Finalize()\n\t\t\t\t// must use reflection here because we don't know the generic type of RespOrErrorUnion\n\t\t\t\tfor {\n\t\t\t\t\trespVal, ok := rtnChVal.Recv()\n\t\t\t\t\tif !ok {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\terrorVal := respVal.FieldByName(\"Error\")\n\t\t\t\t\tif !errorVal.IsNil() {\n\t\t\t\t\t\thandler.SendResponseError(errorVal.Interface().(error))\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\trespData := respVal.FieldByName(\"Response\").Interface()\n\t\t\t\t\thandler.SendResponse(respData, false)\n\t\t\t\t}\n\t\t\t}()\n\t\t\treturn false\n\t\t} else {\n\t\t\thandler.SendResponseError(fmt.Errorf(\"unsupported command type %q\", methodDecl.CommandType))\n\t\t\treturn true\n\t\t}\n\t}\n}\n","sourceCodeStart":155,"sourceCodeEnd":178,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/wshutil/wshadapter.go#L155-L178","documentation":"serverImplAdapter dispatches based on methodDecl.CommandType (e.g. RPCType_Call vs RPCType_Async). If a command's declared type is none of the handled kinds, the adapter replies with this error. This guards against declaration table entries with an unrecognized or newly-added RPC type that the adapter build does not know how to execute.","triggerScenarios":"Invoking a command whose declaration in the generated decl map carries a CommandType the running adapter code does not handle — typically after adding a new RPCType to wshrpc without extending serverImplAdapter's switch, or version skew where declarations and dispatch logic come from different builds.","commonSituations":"Custom forks/patches of Wave Terminal adding new RPC types; mismatched generated declaration code vs adapter logic after refactoring; calling experimental commands present only in development builds.","solutions":["Rebuild/redeploy with matching versions of pkg/wshrpc and pkg/wshutil so declaration types and dispatch logic agree.","If you added a new RPCType, extend the switch in serverImplAdapter to handle it (return async via goroutine or sync via decodeRtnVals).","Check the command's declaration in wshrpc to confirm its CommandType and whether it should instead be Call or Async."],"exampleFix":"// before: new RPCType not handled in serverImplAdapter\n} else {\n    handler.SendResponseError(fmt.Errorf(\"unsupported command type %q\", methodDecl.CommandType))\n}\n// after: add a branch for the new type\n} else if methodDecl.CommandType == wshrpc.RPCType_Stream {\n    go func() { /* stream handling */ }()\n    return false\n} else {\n    handler.SendResponseError(fmt.Errorf(\"unsupported command type %q\", methodDecl.CommandType))\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := client.SendRpcRequest(ctx, cmd, data)\nif err != nil && strings.Contains(err.Error(), \"unsupported command type\") {\n    log.Printf(\"command %s has an RPCType this build cannot dispatch: %v\", cmd, err)\n    return errBuildMismatch\n}","preventionTips":["Keep pkg/wshrpc declarations and pkg/wshutil dispatch logic from the same build.","When adding a new RPCType, update serverImplAdapter's dispatch branches in the same PR.","Avoid calling experimental commands from stable clients."],"tags":["rpc","wsh","dispatch","waveterm"],"backgroundTag":"unsupported-rpc-type","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}