Skip to content

Commit 26ac18b

Browse files
committed
docs(forklog): record the instant home prompt and early input
Adds the feature record for the startup instant prompt (b12845f) and the session record for its stage 1: landing conflicts, upstream issue anomalyco#53696 and PR anomalyco#53698, timings on desktop, m2pro and m4max, and the 1.18.34-vt-144-907b3bc518 installs on desktop and m4max. AI-Tool: opencode 1.18.34-vt-128-907b3bc518 AI-Model: anthropic/claude-opus-5-5 AI-Variant: high AI-Platform: linux AI-Harness: Vibeterm cfa71a2 AI-Session-ID: ses_eebf9a83fffeIQQwW9gVFo5jaO
1 parent b12845f commit 26ac18b

3 files changed

Lines changed: 253 additions & 0 deletions

File tree

‎.vibeterm/forklog/README.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ carries every feature forward unchanged. That commit includes the full
6666
- [Return to the scrolled-up position on messages_first](./features/2026-10-06-tui-home-return.md)
6767
- [Choose which transcript entries show timestamps](./features/2026-10-06-tui-part-timestamps.md)
6868
- [Show the provider and model id in message footers](./features/2026-10-06-tui-model-label.md)
69+
- [Instant home prompt and early input at startup](./features/2026-10-06-tui-instant-prompt.md)
6970
- [Show the session ID in the sidebar](./features/2026-10-06-sidebar-session-id.md)
7071
- [Single-press session abort, /abort and immediate "aborting…" feedback](./features/2026-10-06-tui-session-abort.md)
7172
- [Show and load the messages a long session hides](./features/2026-10-06-tui-history-crop.md)
@@ -75,6 +76,11 @@ carries every feature forward unchanged. That commit includes the full
7576

7677
## Session records
7778

79+
- [2026-10-06 `ses_eebf9a83fffeIQQwW9gVFo5jaO`](./sessions/2026-10-06-tui-instant-prompt.md)
80+
- Paint an editable home prompt within ~50 ms of `opencode` and capture
81+
early input (`startup.instant_prompt`, `startup.early_input`); upstream
82+
issue #53696 and PR #53698; build and install on both hosts.
83+
7884
- [2026-10-06 `ses_eec5b2a34ffe9sjf6Wf21vNSMg`](./sessions/2026-10-06-idle-cpu-startup.md)
7985
- Idle CPU, memory and time to prompt: a hermetic harness, a file logger
8086
that no longer wakes every second (-15% idle CPU; issue #53673, PR
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# Instant home prompt and early input at startup
2+
3+
## Identity
4+
5+
- Status: active
6+
- Integration branch: `dev-nowaker`
7+
- Development branch(es): `provisional-prompt` (also the upstream PR head, `0dae58048c`); landing branch `provisional-prompt-land`
8+
- First local commit: `b12845f999` (cherry-pick of `0dae58048c`)
9+
- Current local commit(s): `b12845f999`
10+
- Upstream base when introduced: `ecc4916b5a` (upstream `dev`, `provisional-prompt`); `dev-nowaker` stays on `907b3bc518`
11+
- Last checked against upstream: `ecc4916b5a` (upstream `dev`)
12+
- Upstream: issue [#53696](https://github.com/anomalyco/opencode/issues/53696), PR [#53698](https://github.com/anomalyco/opencode/pull/53698)
13+
14+
## Original request
15+
16+
Relayed by coordinator `ses_ef8235798ffejGr4sa22eXmVNv` (item 19), quoting the
17+
user:
18+
19+
> additionally, as a tui feature, default on - both for regular tui, and it's
20+
> super minimal alternative version - is to start accepting stdin as early as
21+
> possible; basically even if it's black loading screen, the stdin will be sent
22+
> to the prompt window (except for enter hit, enters should not perform a
23+
> submission and be dropped; shift+enters for line breaks totally fine).
24+
>
25+
> and also separately, a totally new feature - opencode provisional prompt
26+
> screen. basically like a replica of our vibeterm loading screen where we can
27+
> start prompting FAST, without having to wait for opencode to parse all its
28+
> configs, all agents, plugins etc.
29+
30+
> and prompt draft fields, both two screens, must react to mouse clicks for
31+
> caret movement, and the field itself must implement basic terminal things
32+
> like home, end keys, ^w, ^u etc.
33+
34+
The full brief also asks for a 0.2 s budget on desktop, m4max and m2pro, layout
35+
rules shared through a constants-only module, no SQLite on the loading path, a
36+
cache keyed by the database location, the caret kept across the handover, and
37+
white "still loading" / red "changed" notices for Enter during loading.
38+
39+
## Goals
40+
41+
- `opencode` paints the home screen (logo, prompt with the cached agent, model,
42+
variant and colors, shortcuts, cwd, version, a Loading spinner) within about
43+
50 ms and is typable by about 70 ms.
44+
- The prompt edits like the real one: every `input_*` keybind with `tui.json`
45+
overrides, word wrap, click and drag, paste, undo.
46+
- Text, caret and selection hand over exactly to the real home prompt.
47+
- Enter while loading queues the submit. The queued submit goes through once
48+
the TUI loads, but only when agent/model/variant match the cache; otherwise a
49+
red notice asks for Enter again.
50+
- `--mini`, and the TUI with `startup.instant_prompt: false`, capture keys
51+
invisibly (`startup.early_input`), dropping an Enter typed before raw mode.
52+
53+
## Non-goals
54+
55+
- Existing sessions (`-c`, `-s`) and `--prompt` still start as before; stage 2
56+
of item 19 covers the session loading screen.
57+
- Project-level `tui.json` files are not read by the loading screen; they apply
58+
once the TUI loads.
59+
60+
## Rationale and constraints
61+
62+
- The main thread cannot service stdin while it evaluates the CLI's module
63+
graph (0.3-1.7 s blocked on desktop), so a worker thread reads and paints
64+
keys until the renderer takes over.
65+
- The component tree renders nothing until the SDK, sync and theme providers
66+
load. The renderer phase therefore draws the frame from a box on the
67+
renderer root, not from a component.
68+
- The cache sits beside the resolved database (`<db>.tui-startup.json`), so
69+
`OPENCODE_DB`, data directories and channels never share it; the loading path
70+
never opens SQLite.
71+
- Draft persistence stays in Vibeterm (item 16): the early text is claimed in
72+
the prompt's `onMount`, before `handoff.ready`, so a restored orphan draft
73+
never overwrites it.
74+
- Rejected: reading stdin on the main thread between imports. Measured key
75+
latency was 0.6-1.7 s.
76+
77+
## Changes
78+
79+
| Commit | Workday | Change | Stable seam |
80+
|---|---|---|---|
81+
| `b12845f999` | 2026-10-06 | Instant home prompt, early input, startup cache, `startup.*` settings | `packages/opencode/src/boot.ts` and `script/build.ts` entrypoints (`OPENCODE_INSTANT_WORKER_PATH`); `packages/tui/src/instant/*`; `InstantPrompt.handover()` before `createCliRenderer` in `packages/tui/src/app.tsx` and `src/cli/cmd/run/runtime.lifecycle.ts`; `InstantPrompt.claim()` in `Prompt` `onMount` and `footer.prompt.tsx` `bind`; `component/instant-screen.ts`; `packages/tui/src/layout.ts`; `config/keybind-definitions.ts`; `core/src/global-path.ts`; `core/src/database/location.ts`; `Startup` in `config/index.tsx`; `test/instant/*` |
82+
83+
## Verification
84+
85+
- `bun typecheck` in `packages/core`, `packages/tui`, `packages/opencode` on
86+
`provisional-prompt-land`; `bun test` in `packages/tui`: 317 pass, 0 fail.
87+
- `test/instant/editor.test.ts` runs every editing action from every caret
88+
position through the instant editor and opentui's `TextareaRenderable` and
89+
requires identical text, caret and selection; also wrap and caret placement.
90+
- Manual surface, isolated `XDG_*` and tool/plugin data dirs, throwaway tmux
91+
socket `iso19`:
92+
- Instant frame vs loaded TUI: identical rows and colors with a warm cache.
93+
On a cold cache the frame lacks the model line and the prompt's bottom
94+
edge, but its rows are aligned.
95+
- `hello world`, three Left keys, `X`, a click on the second cell and `Y`
96+
before load show `hYello woXrld`, and the caret carries over; `Z` after
97+
load gives `hYZello woXrld`.
98+
- Enter during load: the white notice, then a submit after load. With the
99+
cache edited to another model: the red notice, then a submit on Enter
100+
again.
101+
- Ctrl+C on an empty prompt during load exits with `icanon echo` restored.
102+
- `--help`, `models`, a missing project directory, `--mini` (caret kept)
103+
and `startup.instant_prompt: false` all behave as described.
104+
- The process exits when its tmux server is killed at any time from 0.1 to
105+
20 s after launch.
106+
- Time to typable (pty harness `tmp/latency.py` in the worktree, plus
107+
opencode-idle-bench `ttp --pure`):
108+
- desktop (load ~27): 114 ms median, against 4778 ms for `1.18.34-vt-136`
109+
- m2pro: 72-74 ms, 139 ms on a fresh data dir
110+
- m4max: 71-73 ms, 131 ms on a fresh data dir
111+
112+
Keystroke-to-screen (`capture-pane` polling) is about 10 ms median, worst
113+
83-138 ms, at the handover.
114+
115+
## Timeline
116+
117+
- 2026-10-06
118+
[`ses_eebf9a83fffeIQQwW9gVFo5jaO`](../sessions/2026-10-06-tui-instant-prompt.md)
119+
- `b12845f999`: introduce; upstream issue #53696 and PR #53698; build and
120+
install on desktop and m4max (`1.18.34-vt-144-907b3bc518`).
121+
122+
## Current maintenance notes
123+
124+
- Drop the fork commit once PR #53698 (or an equivalent) is in upstream `dev`.
125+
- An upstream bump must check the following:
126+
- `createCliRenderer` options in `app.tsx` and `runtime.lifecycle.ts` still
127+
let `handover()` run first and `prependInputHandler` feed the instant
128+
editor.
129+
- opentui's `TextareaRenderable` actions still match: the
130+
`test/instant/editor.test.ts` parity test fails if they drift.
131+
- The home layout in `routes/home.tsx`, the `Prompt` box structure and the
132+
home footer/tips plugins still read `layout.ts`.
133+
- Vibeterm's own provisional loader for new-session tabs is being made aware of
134+
this screen in item 19b (`ses_eeadda349ffep0Jwwis5g1DJXi`, opencode-tools).
135+
136+
### Upstream integration checklist
137+
138+
- Locate each stable seam in the new upstream tree.
139+
- Classify the customization as preserved, conflicted, superseded, or removed.
140+
- Reverse any deliberate uncommitted patch before merging, then reapply its
141+
canonical patch afterward.
142+
- Regenerate derived clients or schemas instead of editing generated files.
143+
- Run the feature's focused tests and affected package typechecks.
144+
- Build through the host's canonical installer and verify the installed binary.
145+
- Confirm protected services kept the same PID and start timestamp.
146+
- Link a new timeline row to the current session record.
147+
- Update `Last checked against upstream`.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Instant home prompt and early input at startup
2+
3+
## Identity
4+
5+
- Workday: 2026-10-06
6+
- Session: `ses_eebf9a83fffeIQQwW9gVFo5jaO`
7+
- Agent/platform: `Sisyphus` on `anthropic/claude-opus-5-5` (variant high) / linux, Vibeterm
8+
- Repository: `~/projekty/webapps/opencode`
9+
- Integration branch: `dev-nowaker`
10+
- Development branch(es): `provisional-prompt` (`0dae58048c`, on upstream `dev` `ecc4916b5a`); landing branch `provisional-prompt-land`
11+
- Upstream base: `907b3bc518` (upstream `dev`, contains `v1.18.34`); unchanged
12+
- Source result commit(s): `b12845f999` (cherry-pick of `0dae58048c`)
13+
- Forklog commit: this file's introducing commit
14+
15+
## User requests
16+
17+
Relayed by coordinator `ses_ef8235798ffejGr4sa22eXmVNv` (item 19); the
18+
verbatim requests are quoted in the
19+
[feature record](../features/2026-10-06-tui-instant-prompt.md#original-request).
20+
21+
## Goals
22+
23+
- Stage 1 (this record): new-session instant home prompt, early input for the
24+
TUI and `--mini`, landed on `dev-nowaker`, installed on desktop and m4max.
25+
- Stage 2 (existing-session loading screen) follows on the same development
26+
branch.
27+
28+
## Constraints and non-goals
29+
30+
- Isolation: scratch `XDG_*`, `OPENCODE_TOOLS_DATA_DIR` and
31+
`OPENCODE_PLUGINS_DATA_DIR`, throwaway tmux sockets, never the live
32+
`opencode.db` or config.
33+
- No TUI tab, service or vibeterm tmux server restarted.
34+
35+
## Branch and upstream movement
36+
37+
| Repository | Branch | Before | After | Action |
38+
|---|---|---|---|---|
39+
| `opencode` | `provisional-prompt` | - | `0dae58048c` | new branch on upstream `dev` `ecc4916b5a`; pushed to `nowaker-github` and `origin` |
40+
| `opencode` | `dev-nowaker` | `08f08f672b` | `b12845f999` + this forklog commit | cherry-pick on `provisional-prompt-land`; conflicts in `config/keybind.ts` (the fork's added keybinds moved into `keybind-definitions.ts` unchanged) and `tui.mdx` (kept both sections); fast-forward; pushed to `origin` and `nowaker-github` |
41+
42+
## Features touched
43+
44+
| Feature | Outcome | Evidence |
45+
|---|---|---|
46+
| [Instant home prompt and early input at startup](../features/2026-10-06-tui-instant-prompt.md) | introduced | `b12845f999`; tests; tmux captures; timings |
47+
48+
## Other delivered work
49+
50+
- Upstream: issue #53696 and PR #53698.
51+
- Item 19b handed to `ses_eeadda349ffep0Jwwis5g1DJXi` (opencode-tools): make
52+
Vibeterm skip its own provisional loader when opencode paints this screen,
53+
and check screen-based readiness detection before prompt delivery.
54+
- Pre-push hook: the push to `dev-nowaker` first failed on
55+
`Cannot find module 'jsonc-parser'`, because the primary checkout's
56+
`node_modules` predated the new dependency; `bun install --frozen-lockfile`
57+
there fixed it. Pushes ran the real hook inside
58+
`bwrap ... --tmpfs ~/node_modules` (the ambient `@types/node` issue recorded
59+
by `ses_eec44cf7effeFCqQefM0NkWLaW`).
60+
- opencode-idle-bench `ttp` exposed a bug fixed before landing: an `exec`'d
61+
opencode survived `kill-server` during the first second, because the SIGHUP
62+
handler's terminal restore could throw before `process.exit`.
63+
64+
## Verification
65+
66+
- See the feature record's Verification section: typechecks, 317/0 tui tests on
67+
the landing branch, the parity suite, tmux captures, and timings on desktop,
68+
m2pro and m4max.
69+
- `packages/opencode` `test/cli`, `test/config/tui.test.ts`: the failures seen
70+
were environmental. With `TMPDIR` inside the repo, the config walk-up finds
71+
the repo's own `.opencode/tui.json`. The spawn plugin injected by this
72+
Vibeterm session adds a server plugin. The `resolveZedSelection` tests time
73+
out at load 40. With `TMPDIR` outside the repo, help snapshots and
74+
credential redaction pass.
75+
76+
## Build and install
77+
78+
- Build command: `~/projekty/webapps/opencode/.vibeterm/build.sh` on desktop;
79+
`.vibeterm/build.sh` on m4max after fast-forwarding its checkout to
80+
`b12845f999`.
81+
- Installed artifact: desktop `1.18.34-vt-144-907b3bc518` (inode `49955766`),
82+
m4max `1.18.34-vt-144-907b3bc518` (inode `21913287`). Both contain the
83+
retry-header marker and the instant-prompt strings, and both pass the
84+
keystroke check (52/52 keys shown).
85+
- Retry-header cap: the dirty diff matched the canonical patch on both hosts
86+
before the build.
87+
- Running services: none restarted; `opencode-serve-tailscale` PID `1507297`
88+
and `opencode-serve-lan` PID `1509289` unchanged across the build.
89+
- m2pro: measurement-only scratch clone at `~/projects/tmp/item19-opencode`
90+
(branch `provisional-prompt`), not installed.
91+
92+
## Commit provenance
93+
94+
- `b12845f999` - instant home prompt and early input.
95+
- Required trailer: `AI-Session-ID: ses_eebf9a83fffeIQQwW9gVFo5jaO`
96+
97+
## Unknowns and blocked verification
98+
99+
- No real-terminal recording yet; the PR has a slot for it.
100+
- Vibeterm-side change pending in item 19b.

0 commit comments

Comments
 (0)