Skip to content

Agent Zero AI framework

code-exec ux fixes

3clyp50d5889fa42005
diff --git a/webui/components/messages/process-group/process-group.css b/webui/components/messages/process-group/process-group.css
index 4e24ca0c2..bf305bf42 100644
--- a/webui/components/messages/process-group/process-group.css
+++ b/webui/components/messages/process-group/process-group.css
@@ -446,7 +446,6 @@
transition: grid-template-rows 0.2s ease-out, opacity 0.15s ease-out, margin-top 0.2s ease-out;
overflow: hidden;
-webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
- scroll-behavior: smooth;
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* IE/Edge */
overscroll-behavior: contain; /* avoid scroll chaining */
@@ -488,7 +487,7 @@
}
.process-step.step-expanded > .process-step-detail > .process-step-detail-content {
- max-height: 300px;
+ max-height: 350px;
overflow-y: auto;
}
@@ -500,10 +499,8 @@
background-color: transparent;
font-size: 0.7rem;
line-height: 1.5;
- max-height: 300px;
overflow-y: auto;
-webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
- scroll-behavior: smooth;
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* IE/Edge */
overscroll-behavior: contain; /* avoid scroll chaining */
@@ -656,29 +653,49 @@
margin: var(--spacing-xs) 0 0 0;
padding: var(--spacing-xs);
background: rgba(0, 0, 0, 0.8);
- border-radius: 4px;
+ border-radius: 8px;
color: #c9d1d9;
- white-space: pre-wrap;
- word-break: break-word;
- max-height: 200px;
- overflow-y: auto;
- -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
- scroll-behavior: smooth;
- scrollbar-width: none; /* Firefox */
- -ms-overflow-style: none; /* IE/Edge */
- overscroll-behavior: contain; /* avoid scroll chaining */
+ white-space: pre;
+ max-width: fit-content;
+ max-height: 300px;
+ overflow: auto;
+ -webkit-overflow-scrolling: touch;
+ scrollbar-width: thin;
+ scrollbar-color: rgba(255,255,255,0.2) transparent;
+ overscroll-behavior: contain;
}
.process-step-detail-content .terminal-output::-webkit-scrollbar {
- display: none;
- width: 0;
- height: 0;
+ width: 4px;
+ height: 4px;
+}
+
+.process-step-detail-content .terminal-output::-webkit-scrollbar-track {
+ background: transparent;
+}
+
+.process-step-detail-content .terminal-output::-webkit-scrollbar-thumb {
+ background: rgba(255, 255, 255, 0.2);
+ border-radius: 2px;
+}
+
+.process-step-detail-content .terminal-output::-webkit-scrollbar-thumb:hover {
+ background: rgba(255, 255, 255, 0.35);
}
/* Light mode terminal */
.light-mode .process-step-detail-content .terminal-output {
background: rgba(0, 0, 0, 0.05);
color: black;
+ scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
+}
+
+.light-mode .process-step-detail-content .terminal-output::-webkit-scrollbar-thumb {
+ background: rgba(0, 0, 0, 0.15);
+}
+
+.light-mode .process-step-detail-content .terminal-output::-webkit-scrollbar-thumb:hover {
+ background: rgba(0, 0, 0, 0.3);
}
/* Light mode adjustments */
diff --git a/webui/js/messages.js b/webui/js/messages.js
index 5be8ccf10..6271efe62 100644
--- a/webui/js/messages.js
+++ b/webui/js/messages.js
@@ -1351,6 +1351,11 @@ function addProcessStep(group, id, type, heading, content, kvps, timestamp = nul
// Explicitly add or remove the class based on state
if (newState) {
step.classList.add("step-expanded");
+ // Scroll terminal for newly expanded steps
+ requestAnimationFrame(() => {
+ const terminal = step.querySelector(".terminal-output");
+ if (terminal) terminal.scrollTop = terminal.scrollHeight;
+ });
} else {
step.classList.remove("step-expanded");
}
@@ -1371,6 +1376,14 @@ function addProcessStep(group, id, type, heading, content, kvps, timestamp = nul
detail.appendChild(detailContent);
step.appendChild(detail);
+ // Scroll terminal for already expanded steps
+ if (isStepExpanded) {
+ requestAnimationFrame(() => {
+ const terminal = step.querySelector(".terminal-output");
+ if (terminal) terminal.scrollTop = terminal.scrollHeight;
+ });
+ }
+
// Track delegation steps for nesting
if (toolNameToUse === "call_subordinate") {
currentDelegationSteps[agentNumber] = step;
@@ -1467,9 +1480,17 @@ function updateProcessStep(stepElement, id, type, heading, content, kvps, durati
* Get a concise title for a process step
*/
function getStepTitle(heading, kvps, type) {
+ // code_exe: show command when finished
+ const showCommand = type === "code_exe" && kvps?.code &&
+ /done_all|code_execution_tool/.test(heading || "");
+ if (showCommand) {
+ const s = kvps.session ?? kvps.Session;
+ return `${s != null ? `[${s}] ` : ""}${kvps.runtime || "bash"}> ${kvps.code.trim()}`;
+ }
+
// Try to get a meaningful title from heading or kvps
if (heading && heading.trim()) {
- return cleanStepTitle(heading, 80);
+ return cleanStepTitle(heading, 100);
}
// For warnings/errors without heading, use content preview as title
@@ -1485,13 +1506,13 @@ function getStepTitle(heading, kvps, type) {
return `${kvps.tool_name}${headline ? ': ' + headline : ''}`;
}
if (kvps.headline) {
- return cleanStepTitle(kvps.headline, 80);
+ return cleanStepTitle(kvps.headline, 100);
}
if (kvps.query) {
- return truncateText(kvps.query, 80);
+ return truncateText(kvps.query, 100);
}
if (kvps.thoughts) {
- return truncateText(String(kvps.thoughts), 80);
+ return truncateText(String(kvps.thoughts), 100);
}
}
@@ -1569,12 +1590,17 @@ function renderStepDetailContent(container, content, kvps, type = null) {
const terminalDiv = document.createElement("div");
terminalDiv.classList.add("step-terminal");
- // Show output if present
+ // Show output if present (no truncation - CSS handles max-height)
if (output && output.trim()) {
const outputPre = document.createElement("pre");
outputPre.classList.add("terminal-output");
- outputPre.textContent = truncateText(output, 1000);
+ // Escape HTML first, then convert paths to clickable links
+ let processedOutput = escapeHTML(output);
+ processedOutput = convertPathsToLinks(processedOutput);
+ outputPre.innerHTML = processedOutput;
terminalDiv.appendChild(outputPre);
+ // Scroll terminal to bottom
+ outputPre.scrollTop = outputPre.scrollHeight;
}
container.appendChild(terminalDiv);