ui-server: run-session's error-result test waits only 200 one-millisecond ticks for the first prompt
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- bun, typescript
- Domain
- testing
Research direction
Read the until helper at packages/ui-server/tests/run-session.test.ts:80-86 first: it polls with 200 one-millisecond setTimeouts, which is the budget that runs out under load. Then look at the failing case at run-session.test.ts:452-458 to see what it waits for and whether the prompt exposes a promise that can be awaited instead. Replace the tick count with a wall-clock deadline or that promise, keeping a failure path for a prompt that never arrives. Done means bun run test packages/ui-server/tests/run-session.test.ts passes 20 consecutive runs under a CPU-burn loop and still fails when the first prompt is suppressed.
Written by the indexing model from the issue text.
Description
Context
runSession > an error result fails its turn and is cleared before the next queued turn (packages/ui-server/tests/run-session.test.ts:452-458) waits for the backend's first prompt with until (run-session.test.ts:80-86). until polls 200 times with a 1 ms setTimeout, so its whole budget is roughly 200 ms of timer ticks.
Observed once locally, 2026-11-15, during a 124-file bun run test of ui-server files running alongside other worktrees' suites. It failed with error: condition was not reached at run-session.test.ts:458. The same file passes alone (16/16) on the same tree, and the change under test there (#3733) does not touch runSession. This is a timing budget under CPU load, not a product failure.
Scope
- Give the wait a budget that does not depend on how quickly 1 ms timers fire under load, for example a deadline in wall time or awaiting the prompt's own promise.
Out of scope
runSessionbehaviour.
Acceptance criteria
- The test passes under a CPU-burn loop across 20 consecutive runs, and still fails if the first prompt never arrives.
Verification
bun run test packages/ui-server/tests/run-session.test.ts, under load.
Contract impact
None.
2026-11-16 triage at main 3b104890f8: Verified until (packages/ui-server/tests/run-session.test.ts:80-86) and the prompt wait in the named case. This is a scoped test synchronization repair: wait on the observable prompt or a finite elapsed deadline, record the chosen bound, and retain a prompt-never-arrives negative control within the test’s existing outer timeout. Preserve all run-session outcome/queue assertions and meaningful cleanup. No production or UX choice is open. Preserve p3, add agent-ready, and keep standalone because the matching keyless epic #736 already has 100 direct children.
- Dominant language
- TypeScript
- Stars
- 4
- Forks
- 0
- Avg merge
- 6h 5m
- Merged PRs (30d)
- 730
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from schlessera/brain-kit
-
agent-ready area: ui-server priority: p3 type: test
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
schlessera/brain-kit#4249 ·
Maintainers usually reply within 1 day
-
agent-ready area: ui-server priority: p3 type: test
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
schlessera/brain-kit#4247 ·
Maintainers usually reply within 1 day
-
agent-ready area: ci area: docs priority: p2 type: docs
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
schlessera/brain-kit#4144 ·
Maintainers usually reply within 1 day
-
agent-ready area: ci area: ui-sdk priority: p2 type: test
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
schlessera/brain-kit#4047 ·
Maintainers usually reply within 1 day
-
agent-ready area: ci priority: p2 type: test
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
schlessera/brain-kit#4003 · 1 comment ·
Maintainers usually reply within 1 day
All issues in schlessera/brain-kit
Similar issues
-
documentation tool triaged
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
can1357/oh-my-pi#19608 · 2 comments ·
Maintainers usually reply within 1 day
-
dependencies tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
bcgov/nr-waste-plus#1549 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
blixvip/solana-token-meta#17 ·
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
blixvip/solana-tx-parse#18 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100