wavetermdev/waveterm · error
unsupported command type %q
Error message
unsupported command type %q
What it means
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.
Source
Thrown at pkg/wshutil/wshadapter.go:173
defer handler.Finalize()
// must use reflection here because we don't know the generic type of RespOrErrorUnion
for {
respVal, ok := rtnChVal.Recv()
if !ok {
break
}
errorVal := respVal.FieldByName("Error")
if !errorVal.IsNil() {
handler.SendResponseError(errorVal.Interface().(error))
break
}
respData := respVal.FieldByName("Response").Interface()
handler.SendResponse(respData, false)
}
}()
return false
} else {
handler.SendResponseError(fmt.Errorf("unsupported command type %q", methodDecl.CommandType))
return true
}
}
}
View on GitHub (pinned to a4447c1563)
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.
Example fix
// before: new RPCType not handled in serverImplAdapter
} else {
handler.SendResponseError(fmt.Errorf("unsupported command type %q", methodDecl.CommandType))
}
// after: add a branch for the new type
} else if methodDecl.CommandType == wshrpc.RPCType_Stream {
go func() { /* stream handling */ }()
return false
} else {
handler.SendResponseError(fmt.Errorf("unsupported command type %q", methodDecl.CommandType))
} Defensive patterns
Strategy: try-catch
Try / catch
err := client.SendRpcRequest(ctx, cmd, data)
if err != nil && strings.Contains(err.Error(), "unsupported command type") {
log.Printf("command %s has an RPCType this build cannot dispatch: %v", cmd, err)
return errBuildMismatch
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- command %q not implemented
- command %q not found
- error re-marshalling command data: %w
- command not implemented %q
- command %q invalid multi arg payload
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/8d9b8da6d4ebabfa.
Report an issue: GitHub.