Skip to content

feat(expose): prefer live tap previews - #372

Merged
TraderSamwise merged 1 commit into
masterfrom
feat/expose-live-tap-snapshots
Jul 21, 2026
Merged

feat(expose): prefer live tap previews#372
TraderSamwise merged 1 commit into
masterfrom
feat/expose-live-tap-snapshots

Conversation

@TraderSamwise

@TraderSamwise TraderSamwise commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • prefer live pane tap snapshots when serializing Exposé preview data
  • keep capture snapshots as fallback/repair for tap misses only
  • expand switchable-agent response coverage for tap-over-capture, capture fallback, and tap-only previews

Verification

  • yarn vitest run src/metadata-server.test.ts src/tmux/expose-model.test.ts src/tmux/expose.test.ts
  • yarn typecheck
  • yarn lint
  • yarn build
  • yarn test
  • pre-push hook: yarn typecheck && yarn lint && yarn test

Summary by CodeRabbit

  • Bug Fixes
    • Improved preview snapshots for switchable windows.
    • Previews now prioritize the latest available pane output, with cached snapshots used as a fallback.
    • Ensured previews are correctly displayed across multiple windows, including windows with tap-only or cached preview data.
  • Tests
    • Expanded coverage for multiple preview sources and window configurations.

@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment Jul 21, 2026 3:07am

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b9415652-abf6-46e8-90b2-37b9ef68c497

📥 Commits

Reviewing files that changed from the base of the PR and between 7bd5876 and c06f0e0.

📒 Files selected for processing (2)
  • src/metadata-server.test.ts
  • src/metadata-server.ts

📝 Walkthrough

Walkthrough

The switchable-agents route now reads live pane previews first, falls back to cached previews when needed, and attaches the selected snapshot to each response item. Tests cover distinct preview sources across windows @7, @8, and @9.

Changes

Switchable-agent preview resolution

Layer / File(s) Summary
Tap-first preview resolution
src/metadata-server.ts
The includePreview flow reads pane tap snapshots for all items, queries the preview cache only for tap misses, and prefers tap snapshots when building responses.
Multi-window preview validation
src/metadata-server.test.ts
Test fixtures and assertions cover cached, live-tap, and tap-only previews across windows @7, @8, and @9, including updated call expectations.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: bhanuprasad14

Sequence Diagram(s)

sequenceDiagram
  participant SwitchableAgents as PROJECT_API_ROUTES.controls.switchableAgents
  participant ExposePaneOutputTap
  participant ExposePreviewCache
  SwitchableAgents->>ExposePaneOutputTap: Read previews for `@7`, `@8`, and `@9`
  SwitchableAgents->>ExposePreviewCache: Get previews only for tap misses
  SwitchableAgents-->>SwitchableAgents: Prefer tap snapshot, otherwise cache snapshot
  SwitchableAgents-->>SwitchableAgents: Attach previewSnapshot to each item
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: preferring live pane tap previews over cached capture snapshots.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/expose-live-tap-snapshots

Comment @coderabbitai help to get the list of available commands.

@TraderSamwise
TraderSamwise merged commit 1dd4d7c into master Jul 21, 2026
3 checks passed
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.

1 participant