Skip to content

fix(drive): repair compaction and open-picker probes for current V2 - #78

Merged
kitlangton merged 2 commits into
mainfrom
fix/tui-regression-probes-v2-drift
Sep 2, 2026
Merged

fix(drive): repair compaction and open-picker probes for current V2#78
kitlangton merged 2 commits into
mainfrom
fix/tui-regression-probes-v2-drift

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

Why

Two of the TUI regression probes have failed against every recent OpenCode V2 revision, on both the base and target of each gauntlet run, so 22 of 44 gauntlet configurations were dark with no signal about the PR under test. Both failures are Drive drift behind OpenCode changes, not OpenCode regressions.

What Changes

Probe Before (current V2) After
compact-admission.ts (5 cases × 70/120 cols) The fake model matched the removed "anchored summary" prompt, replied with a plain sentence, and every expected compaction settled as compaction.failed ("did not match the required template"); the probe then timed out waiting for completed. Compaction requests are routed on the stable prompt frame (Summarize only the history shown) and answered with a ##-sectioned summary, so they settle completed and all five invariants in the README table hold unchanged.
open-picker.ts (6 cases × 44/100 cols) Fixture setup threw the bare undefined == true at assert(model) before the TUI launched: model.default / agent.list for a cold location return empty data until plugins activate. The fixture calls plugin.awaitActivation for both project locations before reading the default model and build agent; the asserts carry messages. Closes #74.

Why the compaction reply needed a shape

OpenCode PR #46751 replaced the compaction prompt with a structured template and rejects any summary lacking one of its ## headings. The template wording has already changed once since (#46889), so the probe routes on the surrounding prompt frame rather than the template text.

Client bump

plugin.awaitActivation (OpenCode #46682) is newer than the pinned @opencode-ai/client@0.0.0-dev-18862, so the pin moves to 0.0.0-dev-18911. Typecheck, unit, and CLI integration tests are clean on the new client, and the other manual probes I re-ran decode current responses. A patch changeset records the bump.

Not fixed: multi-tool-interleavings.ts

The third dark probe is a real OpenCode defect, so it is documented in the README rather than papered over. Since OpenCode #46724 the glob tool copies hidden: input.hidden into its permission metadata; an omitted input leaves undefined, which the Record(String, Unknown) response encoder rejects, and GET /api/session/:id/permission answers 400 while the permission is pending. Confirmed against 36095decd7 with a minimal glob call:

glob input permission.list
{ pattern } 400 Expected JSON value at ["data"][0]["metadata"]["path"]
{ pattern, path, limit } (the probe's input) 400 … ["metadata"]["hidden"]
{ pattern, path, limit, hidden: false } 200

Adding hidden: false to the probe would hide a bug that any real model call omitting hidden (or path, or limit) trips.

Verification

Bun 1.4.0; OPENCODE_DEV is a detached worktree of origin/v2 at 36095decd7; every probe run used --daemon and OPENCODE_DRIVE_MEDIA_DIR=$PWD/.drive-output.

bun run --cwd packages/drive typecheck
bun run --cwd packages/drive lint          # 0 errors, 1 pre-existing warning
bun run --cwd packages/drive test          # vitest 252/252, CLI integration 58/58
bun run --cwd apps/catalog typecheck && bun run --cwd apps/catalog test   # 40/40

bun run --cwd packages/drive drive check test/manual/tui-regressions/compact-admission.ts
bun run --cwd packages/drive drive check test/manual/tui-regressions/open-picker.ts
for scenario in ordered coalesce consumed cancelled rollback; do for cols in 70 120; do
  OPENCODE_DRIVE_COMPACT_CASE=$scenario OPENCODE_DRIVE_COLS=$cols \
    bun run --cwd packages/drive drive start --daemon --name "compact-$scenario-$cols" \
      --script test/manual/tui-regressions/compact-admission.ts --dev "$OPENCODE_DEV"
done; done                                 # 10/10 verdict: pass
for scenario in cold warm dispose selection deletion failure; do for cols in 44 100; do
  OPENCODE_DRIVE_OPEN_CASE=$scenario OPENCODE_DRIVE_COLS=$cols \
    bun run --cwd packages/drive drive start --daemon --name "open-picker-$scenario-$cols" \
      --script test/manual/tui-regressions/open-picker.ts --dev "$OPENCODE_DEV"
done; done                                 # 12/12 passed: true
bun run --cwd packages/drive drive start --daemon --name mti \
  --script test/manual/tui-regressions/multi-tool-interleavings.ts --dev "$OPENCODE_DEV"
                                           # still fails at ["data"][2]["metadata"]["hidden"], as documented
bun run --cwd packages/drive drive start --daemon --name qt \
  --script test/manual/tui-regressions/quiescence-tools.ts --dev "$OPENCODE_DEV"   # passes on the new client

compact-admission replied to compaction requests by matching the old
"anchored summary" prompt, which OpenCode PR #46751 replaced with a
structured template whose `##` headings the server now requires. The
fake model routes on the stable prompt frame and returns a template-shaped
summary, so expected compactions settle as completed again.

open-picker read the default model and build agent from a cold location
before plugins had activated, which returns empty data since OpenCode PR
#46639. Bump the pinned client to 0.0.0-dev-18911 for
plugin.awaitActivation and call it for both fixture locations first.

Closes #74
@kitlangton
kitlangton merged commit f6a3f55 into main Sep 2, 2026
1 check passed
@kitlangton
kitlangton deleted the fix/tui-regression-probes-v2-drift branch September 2, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

open-picker: model.default is undefined when read immediately after script-server ready

1 participant