fix: backend not setting agent no; agent no in responses

3clyp50 committed Jan 6, 2026 at 16:26 UTC 6ed9f068c68af565cac0a462edbfc0cfd39b3168
3 files changed +10 -2
python/extensions/before_main_llm_call/_10_log_for_stream.py
+3 -1
@@ -20,7 +20,9 @@ class LogForStream(Extension):
20 )
21
22 def build_heading(agent, text: str, icon: str = "network_intelligence"):
23 - return f"icon://{icon} {text}"
23 + # Include agent identifier for all agents (A0:, A1:, A2:, etc.)
24 + agent_prefix = f"{agent.agent_name}: "
25 + return f"icon://{icon} {agent_prefix}{text}"
26
27 def build_default_heading(agent):
28 return build_heading(agent, "Generating...")
\ No newline at end of file
python/extensions/response_stream/_20_live_response.py
+1 -1
@@ -30,7 +30,7 @@ class LiveResponse(Extension):
30 loop_data.params_temporary["log_item_response"] = (
31 self.agent.context.log.log(
32 type="response",
33 - heading=f"icon://chat Responding",
33 + heading=f"icon://chat {self.agent.agent_name}: Responding",
34 )
35 )
36
python/helpers/log.py
+6
@@ -214,10 +214,16 @@ class Log:
214 ) -> LogItem:
215
216 # add a minimal item to the log
217 + # Determine agent number from streaming agent
218 + agent_number = 0
219 + if self.context and self.context.streaming_agent:
220 + agent_number = self.context.streaming_agent.number
221 +
222 item = LogItem(
223 log=self,
224 no=len(self.logs),
225 type=type,
226 + agent_number=agent_number,
227 )
228 # Set duration on previous item and mark it as updated
229 if self.logs: