restore heading logic for rate limit, error msgs
3clyp50 committed
Jan 6, 2026 at 19:08 UTC
6a21f34a942ad183ed9ac410cc3d448e7459d8e8
2 files changed
+23
-1
python/extensions/agent_init/_10_initial_message.py
-1
@@ -35,7 +35,6 @@ class InitialMessage(Extension):
35
# Add to log (green bubble) for immediate UI display
36
self.agent.context.log.log(
37
type="response",
38
- heading=f"{self.agent.agent_name}: Welcome",
38
content=initial_message_text,
39
finished=True,
40
update_progress="none",
webui/js/messages.js
+23
@@ -246,6 +246,29 @@ export function _drawMessage(
246
// Update message classes
247
messageDiv.className = `message ${mainClass} ${messageClasses.join(" ")}`;
248
249
+ // Handle heading (important for error/rate_limit messages that show context)
250
+ if (heading) {
251
+ let headingElement = messageDiv.querySelector(".msg-heading");
252
+ if (!headingElement) {
253
+ headingElement = document.createElement("div");
254
+ headingElement.classList.add("msg-heading");
255
+ messageDiv.insertBefore(headingElement, messageDiv.firstChild);
256
+ }
257
+
258
+ let headingH4 = headingElement.querySelector("h4");
259
+ if (!headingH4) {
260
+ headingH4 = document.createElement("h4");
261
+ headingElement.appendChild(headingH4);
262
+ }
263
+ headingH4.innerHTML = convertIcons(escapeHTML(heading));
264
+
265
+ // Remove heading if it exists but heading is null
266
+ const existingHeading = messageDiv.querySelector(".msg-heading");
267
+ if (existingHeading) {
268
+ existingHeading.remove();
269
+ }
270
+ }
271
+
272
// Find existing body div or create new one
273
let bodyDiv = messageDiv.querySelector(".message-body");
274
if (!bodyDiv) {