{"record":{"id":"6df3b8a2f4c714cc","repo":"t8y2/dbx","slug":"agentsessionid-is-required-6df3b8","errorCode":null,"errorMessage":"agentSessionId is required","messagePattern":"agentSessionId is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/argo-go/main.go","lineNumber":182,"sourceCode":"\t}\n\tif len(request.ID) == 0 {\n\t\trequest.ID = json.RawMessage(\"1\")\n\t}\n\tresult, shutdown, err := runtimeServer.dispatch(request.Method, request.Params)\n\tif err != nil {\n\t\treturn errorResponse(request.ID, request.Method, stringParam(request.Params, \"agentSessionId\"), err), false\n\t}\n\treturn response{JSONRPC: \"2.0\", ID: request.ID, Result: result}, shutdown\n}\n\nfunc (runtimeServer *runtimeServer) dispatch(method string, params map[string]json.RawMessage) (any, bool, error) {\n\tswitch method {\n\tcase \"handshake\":\n\t\treturn handshakeResult(true), false, nil\n\tcase \"open_session\":\n\t\tid := stringParam(params, \"agentSessionId\")\n\t\tif id == \"\" {\n\t\t\treturn nil, false, errors.New(\"agentSessionId is required\")\n\t\t}\n\t\tvar connection connectParams\n\t\tif err := decodeParams(params, &connection); err != nil {\n\t\t\treturn nil, false, err\n\t\t}\n\t\treturn map[string]bool{\"ok\": true}, false, runtimeServer.openSession(id, connection)\n\tcase \"close_session\":\n\t\treturn map[string]bool{\"ok\": true}, false, runtimeServer.closeSession(stringParam(params, \"agentSessionId\"))\n\tcase \"validate_session\":\n\t\tsession, err := runtimeServer.session(stringParam(params, \"agentSessionId\"))\n\t\tif err != nil {\n\t\t\treturn nil, false, err\n\t\t}\n\t\tsession.mu.Lock()\n\t\tdefer session.mu.Unlock()\n\t\treturn map[string]bool{\"ok\": true}, false, session.server.validateConnection()\n\tcase \"cancel_session\":\n\t\tsession, err := runtimeServer.session(stringParam(params, \"agentSessionId\"))","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/argo-go/main.go#L164-L200","documentation":"dispatch requires every open_session JSON-RPC request to include a non-empty agentSessionId string parameter. This identifier is what scopes and isolates the session created by runtimeServer.openSession. If the parameter is missing or an empty string, the request is rejected before any session state is created, because a session without an ID cannot be addressed or kept isolated from others.","triggerScenarios":"Sending an open_session request whose params object omits agentSessionId, or passes it as an empty string (\"\"). Raised directly in dispatch before decodeParams/connectParams are even processed.","commonSituations":"A client generated the request envelope manually and forgot the field; a serialization layer dropped empty-string fields; an older client version predating the agentSessionId requirement; a proxy or middleware rewrote params and lost the field.","solutions":["Add agentSessionId with a non-empty unique string to the open_session request params","Ensure your JSON serializer does not omit empty-string fields (or send a real generated ID instead of empty)","Upgrade/regenerate the client so it matches the current protocol handshake spec","Log the outgoing params object and confirm agentSessionId survives any proxy/middleware transformation"],"exampleFix":"// before\n{\"method\": \"open_session\", \"params\": {\"connect\": {\"host\": \"localhost\"}}}\n// after\n{\"method\": \"open_session\", \"params\": {\"agentSessionId\": \"sess-9f3a2c\", \"connect\": {\"host\": \"localhost\"}}}","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(params[\"agentSessionId\"]) == \"\" {\n    return errors.New(\"agentSessionId is required\")\n}","typeGuard":null,"tryCatchPattern":"result, err := dispatch(method, params)\nif err != nil && err.Error() == \"agentSessionId is required\" {\n    // fix request params and retry with generated ID\n}","preventionTips":["Always generate a unique non-empty agentSessionId before open_session","Configure JSON serializers to not drop empty fields","Add client-side schema validation for open_session params"],"tags":["jsonrpc","session","validation"],"backgroundTag":"missing-required-parameter","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}