Skip to content

refactor(tui): project production subgroups through tree engine - #48399

Merged
jlongster merged 2 commits into
v2from
session-grouping
Sep 11, 2026
Merged

refactor(tui): project production subgroups through tree engine#48399
jlongster merged 2 commits into
v2from
session-grouping

Conversation

@jlongster

@jlongster jlongster commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Base

Rebased onto the latest v2 after #48394 merged. The diff contains only the production integration. Post-rebase TUI typecheck and 29 grouping/session-row tests pass.

Summary

  • Route existing reasoning/exploration grouping through the generic tree engine for history hydration and live appends.
  • Store child nodes and cached leaf counts in group rows; preserve existing PartRef identity and subgroup renderer behavior.
  • Keep completion, permission partitions, queued inputs and footers session-owned.
  • Hydrate whole batches once to avoid quadratic repeated seam merges.
  • Update existing row fixtures for the new child-node representation.

This increment preserves default grouping membership, labels, loading state, disclosure behavior and navigation. Nested experimental rules, boundary-completing pagination and leaf-based mounting follow separately. The renderer consumes subgroup refs from the tree; there is no separate flat timeline projection.

Verification

  • TUI typecheck passed
  • Full TUI suite: 1352 passed, 4 skipped, 0 failed
  • Local differential suite: 842071 assertions against the original reducer/helper functions, including permission transitions, append while blocked, duplicate admission, hydration/page suffixes, queue placement and message boundaries
  • Local long-history cost check verified batch hydration after removing an initial quadratic path
  • Drive --dev replay: busy/completed states, failed and successful reads, thought/exploration disclosures, narrow layout, last-user navigation; compared expanded layouts with the original extraction worktree
  • Formatting and whitespace checks passed

Large diagnostic suites, screenshots and the work log remain local as requested. A separate Sol review session will review this increment before merge.

Base automatically changed from grouping-engine to v2 September 11, 2026 01:40
@jlongster

Copy link
Copy Markdown
Contributor Author

Drive comparison completed: 201/201 full-screen screenshot pairs are pixel-identical with matching settings between installed OpenCode v0.0.0-dev-19317 and this PR at 2ab7bffdf2.

Coverage: 14 fixed imported fixtures; 80/112/160 columns; top/bottom navigation including paginated histories; grouped/collapsed and ungrouped/expanded settings; manual thought/exploration disclosure open/close checks. Compared full RGBA images without masks or tolerances. The development-only DevTools bar was disabled identically on both sides to match viewport geometry. A clean latest-v2 source comparison was also run.

One separate parity blocker remains: independently reproduced the Sol review finding that pending filtering by partID alone hides a later ref from another assistant message reusing that ID. The focused reproduction still fails; screenshot passes do not cover or clear that edge case. No production changes were made during this verification.

Local report and reproducible scripts: /tmp/opencode/timeline-drive-comparison.md.

@jlongster

Copy link
Copy Markdown
Contributor Author

Follow-up: reproduced the permission identity regression through the real TUI app and client event pipeline, using a controlled HTTP/SSE replay. The same screen assertion passes on production v2 and fails on this PR: production renders “Exploring — 1 read” and can reveal Read visible-b.ts; Dev omits the summary and that row. After permission resolution, the screens match again.

This requires separate live event phases; full hydration/coalesced delivery can mask it. Natural model-run reachability of this ordering is not established.

Four nearby real-TUI controls passed on both builds (distinct IDs, permission resolved first, replayed admission, two pending permissions), with 16/16 pixel-identical stage pairs. A seeded 3000-history / 150000-transition comparison found no additional mismatch beyond this same bug.

Screenshots saved under /mnt/mail, including permission-regression-comparison.png; detailed local report: /mnt/mail/permission-regression-report.md. No fix applied in this investigation.

@jlongster

Copy link
Copy Markdown
Contributor Author

Fixed the pending-reference regression in 38061c251f. groupRefs now matches both messageID and partID; added a committed regression test for reused call IDs across messages and permission resolution.

Verification after the fix:

  • Previously failing real-TUI event replay now passes
  • All 4/4 reproduction screenshots are pixel-identical to production, including the formerly missing summary and expanded tool row
  • Stateful comparison: 150000/150000 transitions match, zero remaining mismatches in that test set
  • Full TUI suite: 1359 passed, 4 skipped, 0 failed
  • Typecheck, formatting and whitespace checks passed

Fixed screenshot: /mnt/mail/permission-repro-dev-fixed-02b-details.png. Original failing screenshots retained for comparison.

@jlongster
jlongster merged commit 4d12e01 into v2 Sep 11, 2026
8 checks passed
@jlongster
jlongster deleted the session-grouping branch September 11, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant