{"record":{"id":"1ff73d32f300df91","repo":"wavetermdev/waveterm","slug":"command-q-not-implemented","errorCode":null,"errorMessage":"command %q not implemented","messagePattern":"command %q not implemented","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wshutil/wshadapter.go","lineNumber":53,"sourceCode":"\tcase 1:\n\t\terrIf := rtnVals[0].Interface()\n\t\tif errIf == nil {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, errIf.(error)\n\tcase 2:\n\t\terrIf := rtnVals[1].Interface()\n\t\tif errIf == nil {\n\t\t\treturn rtnVals[0].Interface(), nil\n\t\t}\n\t\treturn rtnVals[0].Interface(), errIf.(error)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"too many return values: %d\", len(rtnVals))\n\t}\n}\n\nfunc noImplHandler(handler *RpcResponseHandler) bool {\n\thandler.SendResponseError(fmt.Errorf(\"command %q not implemented\", handler.GetCommand()))\n\treturn true\n}\n\nfunc recodeCommandData(command string, data any, commandDataType reflect.Type) (any, error) {\n\tif command == \"\" || commandDataType == nil {\n\t\treturn data, nil\n\t}\n\tmethodDecl := WshCommandDeclMap[command]\n\tif methodDecl == nil {\n\t\treturn data, fmt.Errorf(\"command %q not found\", command)\n\t}\n\tcommandDataPtr := reflect.New(commandDataType).Interface()\n\tif data != nil {\n\t\terr := utilfn.ReUnmarshal(commandDataPtr, data)\n\t\tif err != nil {\n\t\t\treturn data, fmt.Errorf(\"error re-marshalling command data: %w\", err)\n\t\t}\n\t}","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/wshutil/wshadapter.go#L35-L71","documentation":"This error is produced by noImplHandler in pkg/wshutil/wshadapter.go, the placeholder handler the wsh RPC adapter installs for commands that a registered server implementation does not provide at all. When an RPC request arrives and the router maps it to the no-op implementation, the caller receives an error response saying the command is not implemented. It is Wave Terminal's way of distinguishing 'known command, but nothing handles it here' from an unknown command name.","triggerScenarios":"Calling an RPC command (via wsh client or WshRouter) against a server side whose implementation struct was registered with noImplHandler for that command, i.e. the command exists in WshCommandDeclMap but no concrete handler method is wired for this endpoint.","commonSituations":"Connecting a newer wsh client to an older Wave Terminal server that has not implemented the command yet; calling a command that only exists in one domain (e.g. a command implemented only in the UI or only in the server side) from the other side; partial feature rollouts where command declarations are shared but handlers are not.","solutions":["Check the version of the Wave Terminal server you are connected to and upgrade it so the command has a real implementation.","Verify you are calling the command on the correct route/endpoint where a concrete implementation is registered (use wshrpc RouteId constants rather than a guessed route).","If you are developing a new command, register your implementation struct in the server adapter (wsh.RegisterDeclSet / serverImplAdapter with your command method, e.g. MyCommandCommand) instead of the no-impl placeholder."],"exampleFix":"// before: client calls a command not present on the connected server\nresp, err := wsh.GetWshClient().SendRpcRequest(ctx, wshrpc.Command_NewFeatureData{}, nil)\n// after: guard with a version/capability check or fall back\ncapable := wshutil.SupportsCommand(\"command:newfeature\") // or check server version >= v0.11\nif !capable {\n    return fmt.Errorf(\"connected server does not support command:newfeature; upgrade Wave Terminal\")\n}\nresp, err := wsh.GetWshClient().SendRpcRequest(ctx, wshrpc.Command_NewFeatureData{}, nil)","handlingStrategy":"fallback","validationCode":"// Check capability before sending (compare server version or known command set)\nif !supportedCommands.Contains(commandName) {\n    return fmt.Errorf(\"server does not implement %q; upgrade Wave Terminal\", commandName)\n}","typeGuard":null,"tryCatchPattern":"resp, err := client.SendRpcRequest(ctx, cmd, data)\nif err != nil && strings.Contains(err.Error(), \"not implemented\") {\n    // fall back to an older command path or surface an upgrade hint\n    return legacyPath(ctx, data)\n}","preventionTips":["Pin client and server to the same Wave Terminal version.","Wrap RPC calls in a capability-check helper before dispatch.","Surface upgrade guidance to users when a command is unimplemented."],"tags":["rpc","wsh","not-implemented","waveterm"],"backgroundTag":"rpc-command-not-implemented","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}