[bug] Agent.step_user_message → inner_step missing required first_input_messge arg
Severity: Medium — anyone calling Agent.step_user_message directly hits TypeError immediately. The production REST path is unaffected because it routes through server.send_messages → _step, not through step_user_message.
Where
mirix/agent/agent.py:2599 on origin/main.
Reproduction
agent = await server.load_agent(agent_id, actor=client)
await agent.step_user_message("hello")
# TypeError: Agent.inner_step() missing 1 required positional argument: 'first_input_messge'
Root cause
step_user_message calls:
return await self.inner_step(messages=[user_message], **kwargs)
but inner_step's signature requires first_input_messge as a positional argument (the typo is in the original):
async def inner_step(
self,
first_input_messge: Message,
messages: Union[Message, List[Message]],
...
):
Suggested fix
One-line change at mirix/agent/agent.py:2599:
return await self.inner_step(first_input_messge=user_message, messages=[user_message], **kwargs)
Plus a behavioral test in tests/test_agent.py that mocks _get_ai_reply and calls step_user_message, asserting it returns an AgentStepResponse without raising.
Discovery
Surfaced during end-to-end validation of #126 (top-level session_id feature). That PR works around this bug by driving the agent through the production code path server.send_messages → _step (the same path used by REST → queue worker), so step_user_message is never called. This bug is therefore independent of #126 — just a pre-existing latent issue made visible during testing.
Codex review of #126 also flagged this as a medium-severity finding unrelated to that work.
🤖 Generated with Claude Code
Thanks for the clear reproduction. Fixed in https://github.com/Mirix-AI/MIRIX/pull/148, now merged into main.
Agent.step_user_message now passes the constructed user message as both first_input_messge and the input message list when calling inner_step.
Four offline behavioral tests run the real inner step for chat and episodic-memory agents, covering successful responses and model failures. They also verify that the input reaches response handling and persistence, session IDs remain limited to chat agents, and the previous session context is restored after success or failure. Please pull the latest main to pick up the fix.