Agent Zero AI framework
Add verbose tool calls preference and fix step detail scroll
linkliti086eee408963
diff --git a/tests/test_tool_args_preference.py b/tests/test_tool_args_preference.pynew file mode 100644index 000000000..98b36ced5--- /dev/null+++ b/tests/test_tool_args_preference.py@@ -0,0 +1,33 @@+from pathlib import Path+++ROOT = Path(__file__).resolve().parents[1]+++def read(path: str) -> str:+ return (ROOT / path).read_text(encoding="utf-8")+++def test_tool_args_preference_toggle_is_wired_in_webui() -> None:+ store = read("webui/components/sidebar/bottom/preferences/preferences-store.js")+ panel = read("webui/components/sidebar/bottom/preferences/preferences-panel.html")++ assert "get showToolArgs()" in store+ assert "set showToolArgs(value)" in store+ assert "_showToolArgs: false," in store+ assert 'localStorage.getItem("showToolArgs")' in store+ assert 'localStorage.setItem("showToolArgs", value)' in store+ assert "this._applyShowToolArgs(this._showToolArgs);" in store+ assert "_applyShowToolArgs(value)" in store++ assert "Show verbose tool calls" in panel+ assert 'x-model="$store.preferences.showToolArgs"' in panel+++def test_message_stream_gates_tool_args_display_behind_preference() -> None:+ messages = read("webui/js/messages.js")++ assert "if (preferencesStore.showToolArgs) {" in messages+ assert "kvps?.tool_args ?? kvps?.args" in messages+ assert 'kvps.tool_name !== "response"' in messages+ assert 'icon://build[Tool]' in messagesdiff --git a/webui/components/sidebar/bottom/preferences/preferences-panel.html b/webui/components/sidebar/bottom/preferences/preferences-panel.htmlindex 9987c2e63..f17f81741 100644--- a/webui/components/sidebar/bottom/preferences/preferences-panel.html+++ b/webui/components/sidebar/bottom/preferences/preferences-panel.html@@ -72,6 +72,13 @@<span class="slider"></span></label></li>+ <li x-data>+ <span>Show verbose tool calls</span>+ <label class="switch">+ <input type="checkbox" x-model="$store.preferences.showToolArgs">+ <span class="slider"></span>+ </label>+ </li></ul></span></div>diff --git a/webui/components/sidebar/bottom/preferences/preferences-store.js b/webui/components/sidebar/bottom/preferences/preferences-store.jsindex ed16a437c..b8fe45bad 100644--- a/webui/components/sidebar/bottom/preferences/preferences-store.js+++ b/webui/components/sidebar/bottom/preferences/preferences-store.js@@ -62,6 +62,15 @@ const model = {},_showUtils: false,+ get showToolArgs() {+ return this._showToolArgs;+ },+ set showToolArgs(value) {+ this._showToolArgs = value;+ this._applyShowToolArgs(value);+ },+ _showToolArgs: false,+// Chat container width preference for HiDPI/large screensget chatWidth() {return this._chatWidth;@@ -176,6 +185,14 @@ const model = {this._showUtils = false; // Default to speech off if localStorage is unavailable}+ // load tool arguments display preference+ try {+ const storedShowToolArgs = localStorage.getItem("showToolArgs");+ this._showToolArgs = storedShowToolArgs === "true";+ } catch {+ this._showToolArgs = false; // Default to hidden if localStorage is unavailable+ }+this._isMobileViewport = globalThis.innerWidth <= 768;globalThis.addEventListener("resize", () => {this._isMobileViewport = globalThis.innerWidth <= 768;@@ -186,6 +203,7 @@ const model = {this._applyAutoScroll(this._autoScroll);this._applySpeech(this._speech);this._applyShowUtils(this._showUtils);+ this._applyShowToolArgs(this._showToolArgs);this._applyChatWidth(this._chatWidth);this._applyDetailMode(this._detailMode);} catch (e) {@@ -222,6 +240,10 @@ const model = {);},+ _applyShowToolArgs(value) {+ localStorage.setItem("showToolArgs", value);+ },+_applyChatWidth(value) {localStorage.setItem("chatWidth", value);// Set CSS custom property for chat max-widthdiff --git a/webui/js/messages.js b/webui/js/messages.jsindex 872ec09d2..e22c8f67a 100644--- a/webui/js/messages.js+++ b/webui/js/messages.js@@ -1472,6 +1472,7 @@ export function drawProcessStep({kvps,content,contentClasses,+ code,});} else {discardProcessStepDetail(step);@@ -1509,6 +1510,7 @@ function renderProcessStepDetail({kvps,content,contentClasses,+ code,}) {let stepDetailScroll = stepDetail.querySelector(":scope > .process-step-detail-scroll",@@ -1523,7 +1525,7 @@ function renderProcessStepDetail({}const detailScroller = new Scroller(stepDetailScroll, {- smooth: !isMassRender(),+ smooth: code !== "GEN" && !isMassRender(),toleranceRem: 4,});const kvpsTable = drawKvpsIncremental(stepDetailScroll, kvps);@@ -1884,6 +1886,15 @@ export function drawMessageAgent({const title = cleanStepTitle(heading);let displayKvps = {};if (kvps?.thoughts) displayKvps["icon://lightbulb[Thoughts]"] = kvps.thoughts;+ if (preferencesStore.showToolArgs) {+ if (kvps?.tool_name) displayKvps["icon://build[Tool]"] = kvps.tool_name;+ const toolArgs = kvps?.tool_args ?? kvps?.args;+ if (toolArgs) {+ Object.entries(toolArgs).forEach(([key, value]) => {+ if (kvps.tool_name !== "response") displayKvps[key] = value;+ });+ }+ }if (kvps?.step) displayKvps["icon://step[Step]"] = kvps.step;const thoughtsText = String(kvps?.thoughts ?? "");const headerLabels = [