{"record":{"id":"a543db748647470f","repo":"microsoft/autogen","slug":"unknown-attribute-kind","errorCode":null,"errorMessage":"Unknown attribute kind","messagePattern":"Unknown attribute kind","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/_worker_runtime.py","lineNumber":683,"sourceCode":"                    for key, value in attributes.items():\n                        item = None\n                        match value.WhichOneof(\"attr\"):\n                            case \"ce_boolean\":\n                                item = str(value.ce_boolean)\n                            case \"ce_integer\":\n                                item = str(value.ce_integer)\n                            case \"ce_string\":\n                                item = value.ce_string\n                            case \"ce_bytes\":\n                                item = str(value.ce_bytes)\n                            case \"ce_uri\":\n                                item = value.ce_uri\n                            case \"ce_uri_ref\":\n                                item = value.ce_uri_ref\n                            case \"ce_timestamp\":\n                                item = str(value.ce_timestamp)\n                            case _:\n                                raise ValueError(\"Unknown attribute kind\")\n                        result[key] = item\n\n                    return result\n\n                async def send_message(agent: Agent, message_context: MessageContext) -> Any:\n                    with self._trace_helper.trace_block(\n                        \"process\",\n                        agent.id,\n                        parent=stringify_attributes(event.attributes),\n                        extraAttributes={\"message_type\": message_type},\n                    ):\n                        await agent.on_message(message, ctx=message_context)\n\n                future = send_message(agent, message_context)\n            responses.append(future)\n        # Wait for all responses.\n        try:\n            await asyncio.gather(*responses)","sourceCodeStart":665,"sourceCodeEnd":701,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/_worker_runtime.py#L665-L701","documentation":"Raised inside _worker_runtime.py's CloudEvent attribute stringifier while processing an incoming gRPC CloudEvent. The code inspects the protobuf oneof field 'attr' on each CloudEvent.CloudEventAttributeValue and only knows the kinds ce_boolean, ce_integer, ce_string, ce_bytes, ce_uri, ce_uri_ref, and ce_timestamp. If the attribute's oneof resolves to anything else (or is unset and falls to the wildcard case), the worker raises ValueError('Unknown attribute kind') instead of silently mistranslating the attribute. In practice this means the worker received an event whose attribute encoding does not match the protobuf schema it was compiled against.","triggerScenarios":"A GrpcWorkerAgentRuntime receives a CloudEvent from the host (or another worker) whose attribute oneof is not one of the seven handled kinds — typically because the host process runs a different autogen-ext/protobuf version that serializes attributes with a newer field, or the event was hand-crafted/malformed. It fires during _process_event, i.e. on message delivery, not at registration time.","commonSituations":"Version skew between the host runtime and worker runtime in a distributed deployment (host upgraded, worker pinned to an old release); mixed autogen-ext versions across containers; replaying captured protobuf events against a newer/older worker; proxies writing custom attributes into the CloudEvent envelope.","solutions":["Pin the host and all workers to the same autogen-ext version (and therefore the same agent_worker/cloudevent protos) so the attribute schema matches","Regenerate/refresh installed protos: reinstall the package (pip install -U 'autogen-core[grpc] autogen-ext[grpc]') in every process of the deployment","If you control the publisher, restrict CloudEvent extension attributes to plain string types, which map to ce_string and are always handled","If you must interoperate across versions, catch ValueError around message processing and drop/log the offending event rather than letting it crash the worker loop"],"exampleFix":"# before: host on autogen-ext 0.4.x, worker on 0.2.x -> mismatched cloudevent proto\n# after: lock identical versions everywhere\n# requirements.txt (same in host and worker images)\nautogen-ext==0.4.31\nautogen-core==0.4.31","handlingStrategy":"try-catch","validationCode":"def cloudevent_attrs_supported(event) -> bool:\n    kinds = {'ce_boolean','ce_integer','ce_string','ce_bytes','ce_uri','ce_uri_ref','ce_timestamp'}\n    return all(v.WhichOneof('attr') in kinds for v in event.attributes.values())","typeGuard":null,"tryCatchPattern":"try:\n    await runtime.process_event(event)\nexcept ValueError as e:\n    if 'Unknown attribute kind' in str(e):\n        logger.warning('Dropping event %s: unsupported attribute encoding (version skew?)', event.id)\n    else:\n        raise","preventionTips":["Run host and workers on identical autogen-ext versions so protobuf schemas match","Keep custom CloudEvent extension attributes as strings only","Pin autogen-ext/autogen-core versions in all deployment images","Add a contract test replaying a sample event between host and worker versions"],"tags":["grpc","cloudevent","protobuf","version-mismatch","distributed"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}