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.
This commit is contained in:
chengyongru 2026-03-23 09:56:29 +08:00
parent 46d1a6448a
commit 0537c417f6

View File

@ -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]]: