Repository navigation
perf(tui): decouple first paint from runtime startup - #252
Draft
kingsword09 wants to merge 1 commit into
Draft
kingsword09 wants to merge 1 commit into
kingsword09 wants to merge 1 commit into
Conversation
Contributor
|
pkg-pr-new preview for commit npx --yes https://pkg.pr.new/zcode-app-cli@a4561ccThis preview uses the selected commit. PR updates publish automatically after CI succeeds; kingsword09 can also request a preview with |
kingsword09
marked this pull request as draft
November 1, 2026 05:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Move interactive terminal ownership into a lightweight foreground process so synchronous initialization of the official runtime cannot block the first screen or draft editing.
Scope: this improves first paint and terminal continuity; it does not yet make every slash command available immediately.
Changes
Known Limitations / Follow-up
Validation
bun run typecheckbun run test:unit— 81 passedbun run test:tui— 23 passed, including blocked-runtime editing, draft safety, saved appearance, uninterrupted regular/fullscreen handoff, cancellation, and runtime deathbun run test:node— 17 passedbun scripts/check-runtime.tsbun run check:tui— real-runtime first-run, completion, settings/login, and terminal smoke coverage passedbun test test/runtime/guarded-permission-tui.test.ts— native permission deny/approve regression passed against an isolated local mock providerbun run sync:localandgit diff --checkThe full native-runtime suite is not claimed green: earlier broad runs encountered timing-sensitive timeouts; the targeted native permission regression above passes. Tests use isolated homes and mock credentials/providers, not the user's account or inference quota.
Startup Measurement
bun run bench:startup 5, Node v26.4.0, built launcher and official runtime in a real PTY:First paint ranged from 92–293 ms. The benchmark uses a temporary isolated home, disables update/catalog refresh, and submits no prompts. Its first run includes runtime data initialization; these are process-start measurements, not OS cold-cache measurements. Readiness is measured from model/mode status rather than the welcome frame, because the welcome frame now appears before the backend is ready.