[codex] Add local tool trace toggle (#806)

* test: harden tool approval browser contract

* test: cover tool trace display edge cases

* test: cover resumed tool trace edge cases

* feat: hide tool traces by default

* Add local tool trace toggle

---------

Co-authored-by: Zhicheng Han <zhicheng.han@mathematik.uni-goettingen.de>
This commit is contained in:
ekko
2026-05-17 09:01:59 +08:00
committed by GitHub
parent 569ddc28da
commit 0c2bafc619
19 changed files with 975 additions and 29 deletions
@@ -0,0 +1,34 @@
import { ref } from 'vue'
const STORAGE_KEY = 'hermes_show_tool_calls'
function readInitialValue(): boolean {
try {
return localStorage.getItem(STORAGE_KEY) !== 'false'
} catch {
return true
}
}
const toolTraceVisible = ref(readInitialValue())
function setToolTraceVisible(value: boolean) {
toolTraceVisible.value = value
try {
localStorage.setItem(STORAGE_KEY, String(value))
} catch {
// Ignore storage failures; the in-memory toggle still works for this tab.
}
}
function toggleToolTraceVisible() {
setToolTraceVisible(!toolTraceVisible.value)
}
export function useToolTraceVisibility() {
return {
toolTraceVisible,
setToolTraceVisible,
toggleToolTraceVisible,
}
}