6 Commits

Author SHA1 Message Date
can1357 b279db1790 test: refactored test suites to eliminate time-based sleeps and polling loops
- Replaced time-based sleeps and polling loops with event-driven promise resolvers and fake timers across agent and tool tests.
- Migrated test suites to share in-memory auth storage and fixtures using lifecycle hooks.
- Updated catalog model definitions, metadata, and configurations.
2026-08-13 19:32:22 +02:00
Slava Zavadsky 9dc734ce2c test(coding-agent): flush immediate before asserting tiny-title prewarm
Re-applies the race fix from 7b21716754 that 563f00fe31 dropped as
'unrelated': InteractiveMode.init() defers the prewarm behind setImmediate,
and init()'s own awaits are microtasks that can resolve without yielding to
the immediate queue, so asserting right after await init() races under CI's
chunked load. Flush one immediate tick before asserting.
2026-08-09 11:29:37 -04:00
can1357 563f00fe31 chore: drop unrelated test changes from ACP fix 2026-07-31 19:28:41 +02:00
Márton Danóczy c438e43a65 test: used Promise.withResolvers() for immediate-flush per AGENTS.md 2026-07-30 22:53:54 +02:00
Márton Danóczy 7b21716754 test(interactive-mode): fixed flaky title-prewarm assertion race
CI run 30534203707 job 90843506186 failed: 'prewarms the configured local
worker on startup for an unnamed session' expected tinyTitleClient.prewarm
to have been called, but it wasn't.

InteractiveMode.init() queues the prewarm call behind setImmediate so the
spawn syscall never lands ahead of the first render frame. The test
asserted immediately after 'await mode.init()' resolved; if init()'s
remaining awaits settle on already-resolved promises (microtasks only),
the event loop never reaches the check phase before the assertion runs,
so the immediate can still be pending. Flushes one setImmediate tick
before asserting, matching the flushMicrotasks pattern already used in
rpc-input-frame.test.ts and the tui package's render-scheduler tests.

Did not reproduce the failure locally (5/5 passes before and after, run
in isolation) — consistent with a timing race that only surfaces under
CI's parallel chunked load. The fix removes the race regardless of
whether it reproduces locally: the assertion no longer depends on
scheduling luck.
2026-07-30 22:53:54 +02:00
roboomp 3cdb93cd01 fix(tui): prewarm tiny-title worker off the first-submit hot path
The first interactive submit fired session.generateTitle() before
startPendingSubmission() painted the optimistic user row, and
tinyTitleClient.generate() spawned the local tiny-title subprocess
synchronously in #ensureWorker() before its first await. With a local
providers.tinyModel configured, subprocess-spawn latency therefore landed
ahead of the first frame, stalling the first prompt.

Paint the pending row before starting titling, and prewarm an idle,
unref'd worker at TUI startup via a no-op ping (no model load) so the
first submit reuses a live subprocess.

Fixes #6462
2026-07-24 03:48:43 +00:00