From 0537c417f6e730be6dec74899b01cff643c36faa Mon Sep 17 00:00:00 2001 From: chengyongru Date: Mon, 23 Mar 2026 09:56:29 +0800 Subject: [PATCH] fix(context): restore lost current_role parameter from PR #2104 conflict resolution The build_messages() method was missing the current_role parameter that loop.py calls with, causing a TypeError at runtime. This restores the parameter with its default value of "user" to match the original PR #2104. --- nanobot/agent/context.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nanobot/agent/context.py b/nanobot/agent/context.py index 608c11af4..cd4a7e621 100644 --- a/nanobot/agent/context.py +++ b/nanobot/agent/context.py @@ -127,6 +127,7 @@ Reply directly with text for conversations. Only use the 'message' tool to send media: list[str] | None = None, channel: str | None = None, chat_id: str | None = None, + current_role: str = "user", ) -> list[dict[str, Any]]: """Build the complete message list for an LLM call.""" runtime_ctx = self._build_runtime_context(channel, chat_id) @@ -142,7 +143,7 @@ Reply directly with text for conversations. Only use the 'message' tool to send return [ {"role": "system", "content": self.build_system_prompt(skill_names)}, *history, - {"role": "user", "content": merged}, + {"role": current_role, "content": merged}, ] def _build_user_content(self, text: str, media: list[str] | None) -> str | list[dict[str, Any]]: