Skip to content

fix(drive): match current compaction prompt in compact-admission - #118

Open
kitlangton wants to merge 1 commit into
mainfrom
fix-compact-admission
Open

kitlangton wants to merge 1 commit into
mainfrom
fix-compact-admission

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

Why

All five compact-admission.ts cases (ordered, coalesce, consumed, cancelled, and rollback) fail on current OpenCode V2 with error: timed out waiting for settled compactions. OpenCode PR anomalyco/opencode#48058 updated SessionCompaction.buildPrompt from "Summarize only the history shown." to "Summarize only what the user and the assistant said and did.", so the fake model no longer matches compaction requests, returns a plain marker reply (CA_*_DONE) lacking any ## section heading, and causes each compaction to settle as compaction.failed ("Compaction summary did not match the required template").

Closes #106

What Changes

State Compaction request routing Outcome
Before Matches only "Summarize only the history shown" (OpenCode PR #46751) Compaction requests on current V2 fall through to CA_*_DONE, fail the ## heading check after the nudge retry, and time out waiting for completed
After Matches either "Summarize only the history shown" (#46751) or "Summarize only what the user and the assistant" (#48058) Compaction requests receive the ##-sectioned compactionSummary and all five admission cases pass

Scope

Updates packages/drive/test/manual/tui-regressions/compact-admission.ts and packages/drive/test/manual/tui-regressions/README.md only. Compaction admission behavior in OpenCode V2 (PR #45973) is unchanged and passes all five invariants without server or TUI modifications.

Verification

Verified on Linux against OpenCode origin/v2 (903ec2bb35):

# Reproduction before fix (fails with "error: timed out waiting for settled compactions"
# and state-machine-failure.json showing status: "failed", "Compaction summary did not match the required template")
OPENCODE_DRIVE_MEDIA_DIR="$PWD/.drive-output" OPENCODE_DRIVE_COMPACT_CASE=ordered \
  bun run --cwd packages/drive drive start --daemon --name pf-compact-before-ordered \
  --script test/manual/tui-regressions/compact-admission.ts --dev "$OPENCODE_DEV"

# After fix: all 5 cases at 70 and 120 columns + default 100 columns
bun run --cwd packages/drive drive check test/manual/tui-regressions/compact-admission.ts
for scenario in ordered coalesce consumed cancelled rollback; do
  for cols in 70 120; do
    OPENCODE_DRIVE_MEDIA_DIR="$PWD/.drive-output" \
    OPENCODE_DRIVE_COMPACT_CASE="$scenario" OPENCODE_DRIVE_COLS="$cols" \
      bun run --cwd packages/drive drive start --daemon \
        --name "pf-compact-$scenario-$cols" \
        --script test/manual/tui-regressions/compact-admission.ts \
        --dev "$OPENCODE_DEV" || exit 1
  done
done

# Repository checks and package test suite
bun run check
bun run --cwd packages/drive test:effect --maxWorkers=2
bun run --cwd packages/drive test:cli
  • Before fix: ordered failed at timed out waiting for settled compactions with compaction.failed ("Compaction summary did not match the required template") in state-machine-failure.json.
  • After fix: 10/10 runs across {ordered, coalesce, consumed, cancelled, rollback} × {70, 120} columns plus the default 100-column ordered run returned verdict: "pass" (11/11 total). Note: verified on Linux (kitbox); Linux proof does not establish macOS-specific behavior.
  • bun run check, drive check, Vitest (38 files, 277 tests), and CLI integration tests (62 tests) all pass.

This branch has not been deployed

No deployments
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.

compact-admission: compaction routing matches stale prompt text, so every case fails on current V2

1 participant