{"record":{"id":"f71b85961a92c5c4","repo":"FoundationAgents/OpenManus","slug":"32602","errorCode":"-32602","errorMessage":"Invalid params","messagePattern":"Invalid params","errorType":"error_code","errorClass":"ServerError","httpStatus":null,"severity":"error","filePath":"protocol/a2a/app/agent_executor.py","lineNumber":36,"sourceCode":"\nlogging.basicConfig(level=logging.INFO)\nlogger = logging.getLogger(__name__)\n\n\nclass ManusExecutor(AgentExecutor):\n    \"\"\"Currency Conversion AgentExecutor Example.\"\"\"\n\n    def __init__(self, agent_factory: Callable[[], Awaitable[A2AManus]]):\n        self.agent_factory = agent_factory\n\n    async def execute(\n        self,\n        context: RequestContext,\n        event_queue: EventQueue,\n    ) -> None:\n        error = self._validate_request(context)\n        if error:\n            raise ServerError(error=InvalidParamsError())\n\n        query = context.get_user_input()\n        try:\n            self.agent = await self.agent_factory()\n            result = await self.agent.invoke(query, context.context_id)\n            print(f\"Final Result ===> {result}\")\n        except Exception as e:\n            print(\"Error invoking agent: %s\", e)\n            raise ServerError(error=ValueError(f\"Error invoking agent: {e}\")) from e\n        parts = [\n            Part(\n                root=TextPart(\n                    text=(\n                        result[\"content\"]\n                        if result[\"content\"]\n                        else \"failed to generate response\"\n                    )\n                ),","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/protocol/a2a/app/agent_executor.py#L18-L54","documentation":"A JSON-RPC error (code -32602, InvalidParams) raised as ServerError(InvalidParamsError()) by the A2A agent executor when its request validation reports a problem. In the shipped example _validate_request() is a stub returning False, so in the current code this branch is effectively unreachable unless validation is added; it exists as the hook where parameter validation failures become protocol-level errors.","triggerScenarios":"Sending a request to the executor whose context fails _validate_request (once implemented) — e.g. missing user input, malformed message parts, or invalid context/task parameters. With the current stub, only a customized _validate_request that returns True triggers it.","commonSituations":"Developers implementing their own validation logic inside _validate_request and then being surprised clients receive -32602; clients that omit required fields (no text part in the message) when calling the A2A endpoint; mismatched SDK versions where RequestContext shape changed.","solutions":["Inspect what your (or the customized) _validate_request checks and ensure the request satisfies it — typically include a non-empty text part in message.parts.","Log the raw RequestContext (user input, context_id, task_id) before validation to see which field fails.","If you maintain the server, make _validate_request return a descriptive error instead of a bare True/False so clients see which parameter is invalid.","Upgrade the a2a-sdk client/server to matching versions so request serialization matches expectations."],"exampleFix":"# before\ndef _validate_request(self, context: RequestContext) -> bool:\n    return not context.get_user_input()  # empty input -> InvalidParams, no detail\n# after\ndef _validate_request(self, context: RequestContext) -> bool:\n    return not (context.message and context.message.parts)  # explicit, documented rule; send a message with text parts","handlingStrategy":"validation","validationCode":"msg = context.message\nok = msg is not None and any(\n    getattr(p.root, 'text', None) for p in (msg.parts or [])\n)\n# send only requests where ok is True","typeGuard":"def has_text_part(context) -> bool:\n    m = getattr(context, 'message', None)\n    return bool(m and m.parts and any(getattr(p.root, 'kind', None) == 'text' or getattr(p.root, 'text', None) for p in m.parts))","tryCatchPattern":"try:\n    await client.send_message(request)\nexcept ServerError as e:\n    if e.error and e.error.code == -32602:\n        # inspect request payload, add missing text part, resend\n        pass\n    else:\n        raise","preventionTips":["Always include a non-empty text part in A2A message payloads.","If you implement _validate_request, return descriptive errors rather than a bare boolean.","Log the RequestContext fields before validation to pinpoint which parameter fails."],"tags":["a2a","json-rpc","invalid-params","validation"],"backgroundTag":null,"analyzedSha":"52a13f2a57d8c7f6737eefb02ccf569594d44273","analyzedAt":"2026-08-15T02:33:49.993Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}