hide code-exec session no from frontend

3clyp50 committed Jan 21, 2026 at 15:02 UTC dda234ba957b45ae3e5df1a2e4d4bdcf2b3e6138
1 file changed +6 -3
webui/js/messages.js
+6 -3
@@ -1656,17 +1656,20 @@ function updateProcessStep(stepElement, id, type, heading, content, kvps, durati
1656 * Get a concise title for a process step
1657 */
1658 function getStepTitle(heading, kvps, type) {
1659 + // Frontend-only: hide distracting leading session index like "[0] " in titles
1660 + const stripSessionPrefix = (s) => String(s || "").replace(/^\s*\[\d+\]\s*/, "");
1661 +
1662 // code_exe: show command when finished
1663 const showCommand = type === "code_exe" && kvps?.code &&
1664 /done_all|code_execution_tool/.test(heading || "");
1665 if (showCommand) {
1663 - const s = kvps.session ?? kvps.Session;
1664 - return `${s != null ? `[${s}] ` : ""}${kvps.runtime || "bash"}> ${kvps.code.trim()}`;
1666 + return `${kvps.runtime || "bash"}> ${kvps.code.trim()}`;
1667 }
1668
1669 // Try to get a meaningful title from heading or kvps
1670 if (heading && heading.trim()) {
1669 - return cleanStepTitle(heading, 100);
1671 + const cleaned = cleanStepTitle(heading, 100);
1672 + return type === "code_exe" ? stripSessionPrefix(cleaned) : cleaned;
1673 }
1674
1675 // For warnings/errors without heading, use content preview as title