[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:
@@ -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,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user