Skip to content

0.13.0 Dynamic Group stream: missing run_id in agent.py + BlockManager.get_block_by_id attr error (async API) #3051

@Kyujaq

Description

@Kyujaq

Version: letta/letta:0.13.0 (Docker)

Endpoint(s):

POST /v1/groups//messages and /messages/stream

Behavior:

SSE opens (200 + text/event-stream), then error

Errors observed:

TypeError: convert_message_creates_to_messages() missing 1 required positional argument: 'run_id' called from /app/letta/agent.py:783

AttributeError: 'BlockManager' object has no attribute 'get_block_by_id' (seems new async API is get_block_by_id_async)

Notes:

Agents stream fine via /v1/agents//messages/stream

We fixed persona/human blocks + optional composio imports; only group path fails

Expected: group step/step_stream should emit events

Actual: internal error payload {"error":"Stream failed (internal error occurred)"} then [DONE]

File "/app/letta/agent.py", line 897, in inner_step
blocks=[self.block_manager.get_block_by_id(block.id, actor=self.user) for block in self.agent_state.memory.get_blocks()],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/letta/agent.py", line 897, in
blocks=[self.block_manager.get_block_by_id(block.id, actor=self.user) for block in self.agent_state.memory.get_blocks()],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'BlockManager' object has no attribute 'get_block_by_id'
Letta.letta.utils - ERROR - multi_agent_step_thread failed with AttributeError: 'BlockManager' object has no attribute 'get_block_by_id'
Traceback (most recent call last):
File "/app/letta/utils.py", line 1115, in wrapper
await coro
File "/usr/lib/python3.11/asyncio/threads.py", line 25, in to_thread
return await loop.run_in_executor(None, func_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/letta/groups/round_robin_multi_agent.py", line 163, in step
raise e
File "/app/letta/groups/round_robin_multi_agent.py", line 109, in step
usage_stats = participant_agent.step(
^^^^^^^^^^^^^^^^^^^^^^^
File "/app/letta/otel/tracing.py", line 273, in sync_wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/app/letta/agent.py", line 795, in step
step_response = self.inner_step(
^^^^^^^^^^^^^^^^
File "/app/letta/agent.py", line 1088, in inner_step

Letta.letta.server.rest_api.utils - ERROR - Expected LettaUsageStatistics, got <class 'NoneType'>
Letta.letta.server.rest_api.utils - ERROR - Caught unexpected Exception: Expected LettaUsageStatistics, got <class 'NoneType'>
Letta.letta.llm_api.openai_client - WARNING - Failed to convert tool function to structured output, tool=type='function' function=FunctionSchema(name='ha_call_service', description='Call a Home Assistant service synchronously.', parameters={'type': 'object', 'properties': {'thinking': {'type': 'string', 'description': 'Deep inner monologue private to you only.'}, 'domain': {'type': 'string', 'description': "HA domain (e.g. 'light')."}, 'service': {'type': 'string', 'description': "Service name (e.g. 'turn_on')."}, 'data': {'type': 'object', 'description': 'Optional service payload.'}, 'request_heartbeat': {'type': 'boolean', 'description': 'Request an immediate heartbeat after function execution. You MUST set this value to True if you want to send a follow-up message or run a follow-up tool call (chain multiple tools together). If set to False (the default), then the chain of execution will end immediately after this function call.'}}, 'required': ['thinking', 'domain', 'service', 'request_heartbeat'], 'additionalProperties': False}, strict=True), error=Property {'type': 'object', 'description': 'Optional service payload.'} of type object is missing properties
Letta.letta.llm_api.openai_client - WARNING - Failed to convert tool function to structured output, tool=type='function' function=FunctionSchema(name='alert_notify', description='Send a notification payload to the configured webhook.', parameters={'type': 'object', 'properties': {'thinking': {'type': 'string', 'description': 'Deep inner monologue private to you only.'}, 'message': {'type': 'string', 'description': 'Human readable message.'}, 'severity': {'type': 'string', 'description': 'Severity label (info|warn|critical).'}, 'data': {'type': 'object', 'description': 'Optional structured payload.'}, 'request_heartbeat': {'type': 'boolean', 'description': 'Request an immediate heartbeat after function execution. You MUST set this value to True if you want to send a follow-up message or run a follow-up tool call (chain multiple tools together). If set to False (the default), then the chain of execution will end immediately after this function call.'}}, 'required': ['thinking', 'message', 'request_heartbeat'], 'additionalProperties': False}, strict=True), error=Property {'type': 'object', 'description': 'Optional structured payload.'} of type object is missing properties
Letta.letta.llm_api.openai_client - WARNING - Failed to convert tool function to structured output, tool=type='function' function=FunctionSchema(name='memory_write', description='Persist text into the memory embedding store.', parameters={'type': 'object', 'properties': {'thinking': {'type': 'string', 'description': 'Deep inner monologue private to you only.'}, 'text': {'type': 'string', 'description': 'Content to store.'}, 'kind': {'type': 'string', 'description': 'Memory kind label.'}, 'source': {'type': 'string', 'description': 'Logical source label.'}, 'meta': {'type': 'object', 'description': 'Optional metadata dict.'}, 'memory_id': {'type': 'string', 'description': 'Optional existing identifier for upsert.'}, 'request_heartbeat': {'type': 'boolean', 'description': 'Request an immediate heartbeat after function execution. You MUST set this value to True if you want to send a follow-up message or run a follow-up tool call (chain multiple tools together). If set to False (the default), then the chain of execution will end immediately after this function call.'}}, 'required': ['thinking', 'text', 'request_heartbeat'], 'additionalProperties': False}, strict=True), error=Property {'type': 'object', 'description': 'Optional metadata dict.'} of type object is missing properties
Letta.letta.llm_api.openai_client - WARNING - Failed to convert tool function to structured output, tool=type='function' function=FunctionSchema(name='memory_update', description='Update an existing memory entry (same contract as memory_write).', parameters={'type': 'object', 'properties': {'thinking': {'type': 'string', 'description': 'Deep inner monologue private to you only.'}, 'memory_id': {'type': 'string', 'description': 'Identifier returned by memory_write that should be updated.'}, 'text': {'type': 'string', 'description': 'New content that replaces the previous memory text.'}, 'kind': {'type': 'string', 'description': "Optional classification label for the memory (defaults to 'note')."}, 'source': {'type': 'string', 'description': "Optional logical source label for auditing (defaults to 'agent')."}, 'meta': {'type': 'object', 'description': 'Optional metadata dictionary stored alongside the memory.'}, 'request_heartbeat': {'type': 'boolean', 'description': 'Request an immediate heartbeat after function execution. You MUST set this value to True if you want to send a follow-up message or run a follow-up tool call (chain multiple tools together). If set to False (the default), then the chain of execution will end immediately after this function call.'}}, 'required': ['thinking', 'memory_id', 'text', 'request_heartbeat'], 'additionalProperties': False}, strict=True), error=Property {'type': 'object', 'description': 'Optional metadata dictionary stored alongside the memory.'} of type object is missing properties
httpx - INFO - HTTP Request: POST http://ollama-text:11434/v1/chat/completions "HTTP/1.1 200 OK"
Letta.letta.llm_api.helpers - WARNING - Overwriting existing inner monologue () with kwarg (User has logged in for the first time. Let's start off with a friendly greeting.)
INFO: 172.21.0.1:59710 - "POST /v1/agents/agent-51220cc3-4648-4096-9bf2-c2484ef15571/messages/stream HTTP/1.1" 200 OK
Letta.agent-51220cc3-4648-4096-9bf2-c2484ef15571 - INFO - Running final update. Step Progression: StepProgression.FINISHED
Letta.agent-51220cc3-4648-4096-9bf2-c2484ef15571 - INFO - Total tokens 3678 does not exceed configured max tokens 8192, passing summarizing w/o force.
Letta.letta.services.run_manager - WARNING - Run run-d1257c86-1d84-485c-b81b-db88e978ee70 completed without a completed_at timestamp
INFO: 172.21.0.1:45288 - "POST /v1/groups/group-ef05bb2b-fc6e-4665-8448-0f2acb229573/messages/stream HTTP/1.1" 200 OK
Letta.letta.agent - ERROR - step() failed
messages = [Message(created_by_id=None, last_updated_by_id=None, created_at=datetime.datetime(2025, 10, 25, 22, 16, 34, 658066, tzinfo=datetime.timezone.utc), updated_at=None, id='message-f328e4b6-a7bf-4117-9a41-0dee8ea49cb0', agent_id='agent-51220cc3-4648-4096-9bf2-c2484ef15571', model=None, role=<MessageRole.user: 'user'>, content=[TextContent(type=<MessageContentType.text: 'text'>, text='{\n "type": "user_message",\n "message": "Say hello in 3 words",\n "time": "2025-10-25 10:16:34 PM UTC+0000"\n}', signature=None)], name=None, tool_calls=None, tool_call_id=None, step_id=None, run_id='d85ed853-5aaa-4777-8058-815ea18593af', otid=None, tool_returns=None, group_id='group-ef05bb2b-fc6e-4665-8448-0f2acb229573', sender_id=None, batch_item_id=None, is_err=None, approval_request_id=None, approve=None, denial_reason=None, approvals=None)]
error = 'BlockManager' object has no attribute 'get_block_by_id'
Letta.letta.agent - ERROR - step() failed with an unrecognized exception: ''BlockManager' object has no attribute 'get_block_by_id''
Traceback (most recent call last):
File "/app/letta/agent.py", line 897, in inner_step
blocks=[self.block_manager.get_block_by_id(block.id, actor=self.user) for block in self.agent_state.memory.get_blocks()],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/letta/agent.py", line 897, in
blocks=[self.block_manager.get_block_by_id(block.id, actor=self.user) for block in self.agent_state.memory.get_blocks()],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'BlockManager' object has no attribute 'get_block_by_id'
Letta.letta.utils - ERROR - multi_agent_step_thread failed with AttributeError: 'BlockManager' object has no attribute 'get_block_by_id'
Traceback (most recent call last):
File "/app/letta/utils.py", line 1115, in wrapper
await coro
File "/usr/lib/python3.11/asyncio/threads.py", line 25, in to_thread
return await loop.run_in_executor(None, func_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/letta/groups/round_robin_multi_agent.py", line 163, in step
raise e
File "/app/letta/groups/round_robin_multi_agent.py", line 109, in step
usage_stats = participant_agent.step(
^^^^^^^^^^^^^^^^^^^^^^^
File "/app/letta/otel/tracing.py", line 273, in sync_wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/app/letta/agent.py", line 795, in step
step_response = self.inner_step(
^^^^^^^^^^^^^^^^
File "/app/letta/agent.py", line 1088, in inner_step

Letta.letta.server.rest_api.utils - ERROR - Expected LettaUsageStatistics, got <class 'NoneType'>
Letta.letta.server.rest_api.utils - ERROR - Caught unexpected Exception: Expected LettaUsageStatistics, got <class 'NoneType'>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions