TestStatusBarShowsSessionTokens: once the counter is non-zero it appears in the status bar; at zero the bar stays quiet.
(t *testing.T)
| 2270 | if w := toolCallLeakWarning([]chmctx.Message{{Role: chmctx.RoleAssistant, Content: clean}}); w != "" { |
| 2271 | t.Fatalf("clean reply must not warn, got %q", w) |
| 2272 | } |
| 2273 | // A message that carried a real structured tool call never leaked, even if |
| 2274 | // its prose quotes the `<tool_call>` tag: the ToolCalls gate keeps it clean. |
| 2275 | withCall := chmctx.Message{ |
| 2276 | Role: chmctx.RoleAssistant, |
| 2277 | Content: "Running the build via a <tool_call> now.", |
| 2278 | ToolCalls: []chmctx.ToolCall{{ID: "1", Name: "bash", Arguments: map[string]any{"cmd": "go build ./..."}}}, |
| 2279 | } |
| 2280 | if w := toolCallLeakWarning([]chmctx.Message{withCall}); w != "" { |
| 2281 | t.Fatalf("a turn with a structured tool call must not warn on incidental prose, got %q", w) |
| 2282 | } |
| 2283 | // An old leak followed by a clean reply must stay silent: only the newest |
| 2284 | // assistant message is the one that just ended the turn. |
| 2285 | hist := []chmctx.Message{ |
nothing calls this directly
no test coverage detected