WithClock replaces the runtime's clock. Defaults to time.Now. Tests that need deterministic timestamps (assistant message CreatedAt, fallback cooldown windows, tool-call latency) can pass a fake clock so assertions don't depend on wall-clock advancement.
(now func() time.Time)
| 438 | // cooldown windows, tool-call latency) can pass a fake clock so assertions |
| 439 | // don't depend on wall-clock advancement. |
| 440 | func WithClock(now func() time.Time) Opt { |
| 441 | return func(r *LocalRuntime) { |
| 442 | if now != nil { |
| 443 | r.now = now |
| 444 | } |
| 445 | } |
| 446 | } |
| 447 | |
| 448 | // WithTelemetry replaces the runtime's Telemetry sink. Defaults to a |
| 449 | // pass-through to the package-level pkg/telemetry helpers. Tests pass a |
no outgoing calls