feat(tui): add turn token usage diagnostics (#38398)

This commit is contained in:
James Long 2026-07-23 10:00:51 -04:00 committed by GitHub
commit 5b1321a8ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 175 additions and 12 deletions

View file

@ -59,6 +59,7 @@ export function DevToolsBar() {
const canSwitchMode = () => supports(nextMode())
const runtime = createMemo(() => runtimeStatus(frontendSamples()))
const timing = () => config.data.debug?.timing ?? false
const turnTokens = () => config.data.debug?.turn_tokens ?? false
const offEscape = keymap.intercept(
"key",
@ -352,6 +353,16 @@ export function DevToolsBar() {
>
{timing() ? "[x]" : "[ ]"} Time to first draw
</Action>
<Action
onClick={() =>
void config.update((draft) => {
draft.debug = { ...draft.debug, turn_tokens: !turnTokens() }
})
}
hoverBackground
>
{turnTokens() ? "[x]" : "[ ]"} Turn token usage
</Action>
</box>
<For each={groups()}>
{(group) => (
@ -403,7 +414,7 @@ function PanelBox(props: ParentProps) {
position="absolute"
zIndex={2600}
bottom={1}
left={0}
left={-1}
width={42}
paddingLeft={2}
paddingRight={2}

View file

@ -222,14 +222,6 @@ const settings: Setting[] = [
values: [false, true],
labels: ["off", "on"],
},
{
title: "DevTools: Timing",
category: "Debug",
path: ["debug", "timing"],
default: true,
values: [false, true],
labels: ["off", "on"],
},
]
export function DialogConfig() {