Skip to content

test: wait for remote terminal grid convergence after reveal - #23738

Merged
nwparker merged 2 commits into
mainfrom
nwparker/ci-paired-grid-convergence
Sep 29, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/ci-paired-grid-convergence

Conversation

@nwparker

@nwparker nwparker commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​29 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​27
Prod 0 0 0 0

ELI5

The remote-terminal test sometimes checked terminal dimensions while the revealed pane was still resizing. It now waits for the pane and host process to report the same positive size.

What Changed

Replace the one-shot geometry comparison with a bounded poll of the actual pane grid and the host process's latest READY/SIZE record. Keep immediate keyboard input, host receipt, live echo, hidden-resize suppression, and final exact grid assertions.

Why

Full Linux run 36497243185 restored and echoed input in all three scenarios, but sampled the cold-parked pane at 75×60 while the host reported 37×46. The test claimed to check convergence without waiting for it. This uses the existing 20-second reveal budget and observes both endpoints instead of adding a sleep or increasing timeouts.

Linked Issue

CI failure in https://github.com/stablyai/orca/actions/runs/36497243185

Visual Proof

N/A — test synchronization only; no application behavior changes.

Testing

  • Hidden Electron/macOS paired-host journey passed; final diagnostic-preserving revision passed in 31.9 seconds.
  • Six runtime subscription contract tests and the changed-code quality gate passed.
  • Linux paired-host journey passed (40.3 seconds): https://github.com/stablyai/orca/actions/runs/36501401971
  • Both runs verified host input receipt, live echo, and exact positive grids in all three reveal scenarios. Their initial grids already matched, so neither reproduced the original race.
  • Invariant: terminal-geometry.visible-convergence; gate: runtime.streaming-subscription-close-delivery (experimental).
  • Oracle/wait: compare renderer grid against out-of-band host process size until equal, within the existing reveal budget. Initial and final grids remain in diagnostics. The final poll runs after screenshots and any failure-only tab flip; its soft assertion still fails the test while preserving the complete scenario report.
  • Coverage: macOS/Linux paired runtime covered; Windows, direct SSH, WSL, and mobile are unexercised gaps. Local/daemon behavior and wire formats are unchanged.
  • Performance: test-only bounded polling; no application polling or subprocess changes.

Review

Exact identity, live input, and paint assertions retained. Persistent geometry mismatches still fail.

Agent skill upstream boundary

  • Not applicable.

Checklist

  • Small, focused change; mechanism and rationale explained.
  • No visual change.
  • Self-reviewed; platform and remote scope considered.
  • CI checks complete.

@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Low risk] Test adds a convergence check to an end-to-end test.

The PR appears safe to merge, though the geometry check should retain its ability to diagnose the original unflipped reveal.

Findings

  1. P2 Final grids can become stale ▶

Summary

The test now captures reveal diagnostics before polling for positive, matching renderer and host PTY grids, and records convergence failures without stopping subsequent scenario reporting.

Reviews (2) · Last reviewed commit: "test: retain reveal diagnostics on geome..."

Comment on lines 340 to +341
paneGrid,
ptyGrid: readPtyGridFromContent(sink),
ptyGrid,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Final grids can become stale

The poll stops at the first matching pane and host sizes, and these returned values are the same ones checked by the final assertion. If the pane resizes again after that sample—including during the later tab flip—the test can pass while the pane and host end at different sizes. Re-read both sizes for the final check.

Knowledge Base Used: Terminal runtime and interaction

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 8b0990dc-cfdf-4216-8421-65474ee2a95e

📥 Commits

Reviewing files that changed from the base of the PR and between 2c69c7d and 826cc6f.

📒 Files selected for processing (1)
  • tests/e2e/paired-remote-terminal-parked-reveal-interactivity.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The end-to-end interactivity probe stores and logs the initial pane and PTY grids. After the live-paint and optional tab-flip checks, it polls for positive pane dimensions and matching pane and PTY rows and columns until REVEAL_BUDGET_MS expires. A failed poll does not prevent the scenario report from being returned. The result uses the latest sampled PTY grid.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 826cc

This only changes a test probe to wait for terminal grid sizes to match. It does not affect application behavior and carries no identified merge risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
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.
Title check ✅ Passed The title clearly and concisely describes the main change: adding convergence polling for the remote terminal grid after reveal.
Description check ✅ Passed The description is complete and focused. It explains the problem, change, rationale, testing, scope, limitations, and review status. The linked item is a CI run rather than an issue, and the final CI …
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one minor observation on a now-redundant assertion.

Reviewed changes

  • Bounded grid-convergence poll in probeInteractivity: replaces the one-shot pane-vs-PTY geometry comparison with an expect.poll that waits (within the existing 20s reveal budget) for the revealed client pane grid and the host fixture's last READY|SIZE: grid to match, requiring both to be non-null and the pane grid positive.
  • ptyGrid now taken from the converged tick: the returned ScenarioResult.ptyGrid no longer re-reads the sink after the optional flip workaround; hostReceivedInput still reads sink directly, and all paint/restore assertions are unchanged.

ℹ️ Nitpicks

  • The per-scenario assertion at lines 519-522 compares result.ptyGrid against result.paneGrid, and both now come from the poll's successful tick, so it can no longer fail — the convergence guarantee has moved entirely into the poll. If you want the end-of-run assertion to remain an independent guard, re-read both grids after the poll; otherwise it can be dropped to avoid implying a check that is no longer load-bearing.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@greptile-apps

greptile-apps Bot commented Sep 29, 2026

Copy link
Copy Markdown

Comments Outside Diff

These findings could not be posted inline.

  • P2 Flip masks reveal geometry tests/e2e/paired-remote-terminal-parked-reveal-interactivity.spec.ts:302 ▶

    When live paint fails, the test now switches tabs before checking the pane and host sizes. Switching back can resize the target pane, so the check may report convergence only because of the workaround. The live-paint assertion still fails, but the result no longer independently shows whether the original reveal had a size problem. Check convergence before the diagnostic tab flip.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

What changed since the prior pullfrog review (2c69c7d), all in probeInteractivity:

  • Diagnostics moved ahead of the poll: the pane diagnostics read, screenshot capture, and test.info().attach now run immediately after the initial grid sample, so they land even when convergence fails.
  • Tab-flip workaround moved ahead of the poll: the if (!paintedLive) flip/re-reveal now runs before the bounded poll, so the geometry check reflects the post-workaround visible state.
  • Poll made soft: expect.configure({ soft: true }).poll(...) records a mismatch instead of throwing, so the scenario report still returns and [paired-reveal] still logs; the unchanged per-scenario hard assertion keeps failing the test on a genuine mismatch.

The soft poll cleanly resolves Greptile's "timeout skips failure diagnostics" concern while keeping a real failure path, and the previously noted tautological final assertion is now moot on the failure path.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@nwparker
nwparker merged commit d606be3 into main Sep 29, 2026
42 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