TestEventErrorPreservesStreamedText: a stream error mid-content flushes the partial text before appending the error line, same principle as cancel, user keeps the context they were reading.
(t *testing.T)
| 2711 | stale := toolResultMsg{ |
| 2712 | Msg: chmctx.Message{Role: chmctx.RoleTool, ToolCallID: "stale", Content: "ghost"}, |
| 2713 | turnCtx: ctxStale, |
| 2714 | } |
| 2715 | out, cmd := m.Update(stale) |
| 2716 | om := out.(Model) |
| 2717 | if len(om.history) != beforeLen { |
| 2718 | t.Fatalf("stale tool result entered live history: %+v", om.history) |
| 2719 | } |
| 2720 | if om.stream != beforeStream { |
| 2721 | t.Fatal("stale tool result triggered a fresh startChat - live stream replaced") |
| 2722 | } |
| 2723 | if cmd != nil { |
| 2724 | t.Fatalf("stale tool result returned a Cmd; should be no-op: %T", cmd) |
| 2725 | } |
| 2726 | } |
| 2727 | |
| 2728 | // TestRunToolCallHonorsBashTimeoutBeyondLegacyCap: bash's own timeout is the only |
| 2729 | // ceiling: runToolCall must not wrap the parent context in a shorter cap. Runs a |
| 2730 | // fast `echo` with a 1800s tool-arg timeout and asserts it completes normally. |
| 2731 | func TestRunToolCallHonorsBashTimeoutBeyondLegacyCap(t *testing.T) { |
| 2732 | parent := context.Background() // no outer deadline |
| 2733 | cmd := runToolCall(parent, chmctx.ToolCall{ |
| 2734 | ID: "t-cap", |
nothing calls this directly
no test coverage detected