Skip to content

test(take-over): hold a displaced attach's "taken over" line until its exit too - #2396

Merged
devswha merged 1 commit into
mainfrom
test/take-over-displacement-hold
Oct 29, 2026
Merged

devswha merged 1 commit into
mainfrom
test/take-over-displacement-hold

Conversation

@devswha

@devswha devswha commented Oct 29, 2026

Copy link
Copy Markdown
Owner

This is the second commit of #2373, which merged at its first commit (7597f65) before this one reached the branch. It was reviewed there; it is cherry-picked onto current main here.

Found by the flake-hunt lane on #2380's Integration run (job 123700768179): server/take-over.contract.test.ts "consumes a click when the running ordinary retry succeeds, before later displacement" failed at :89, where pty-data contained "terminal attach taken over".

Cause (test flake)

This is the same cause as #2373: the 100 ms default attach hold. Displaced by another client's --takeover, herdr prints its teardown and "terminal attach taken over", then exits. The bridge keeps an attach's last line in the output tail for the hold (tailTimer in server/core/terminal-process.ts) and drops it at a displaced exit (flushTail(displaced)). An exit more than 100 ms after the line, as on a busy runner, let the line reach clients first.

Change

A 2 s hold for this test too, as #2373 gave the ordinary-failure test. The changelog fragment from #2373 now names both tests.

Proof

  • Fail-first: with the fixture's real wrapper exiting 300 ms after herdr (scratch), the old test failed 3/3 with CI's not.toContain and the new one passed 3/3.
  • Whole file: passed 9/9 three times. On current main with this cherry-pick it passed 9/9 again (bun run check run bun test server/take-over.contract.test.ts).
  • Local checks: bun run check fast ok.

Test-only.

Reviews

  • omo-native-code-reviewer: APPROVE, CLEAR (on test(take-over): hold a failing attach's last line until its exit on a busy runner #2373's branch). It confirmed the tail-hold mechanism and that the test still asserts the consumed click, the retry without --takeover, and no taken-over text.
    • LOW product note, not fixed here: production also holds the tail 100 ms, so on a loaded machine, when another client takes over, a user can briefly see herdr's teardown line until the next attach redraws. A longer tail hold for displacement would remove it.
  • Test-only, so no Codex review (notes/pr-policy.md).

…s exit too

"consumes a click when the running ordinary retry succeeds, before later
displacement" used the 100 ms default hold. Displaced by another client's
--takeover, herdr prints "terminal attach taken over" and then exits; the
bridge holds an attach's last line for the hold and drops it at the exit, so
an exit later than 100 ms (a busy runner) let the line reach pty-data and
the test's not.toContain failed (#2380's Integration run). Hold for 2 s, as
the ordinary-failure test now does.

Fail-first with the stand-in's exit delayed 300 ms after herdr's (scratch):
old 3/3 fail, new 3/3 pass; the whole file passed 9/9 three times; bun run
check fast ok.
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 421689b and 6df94b3.

Files selected for processing: 2
  • changelog.d/integration-flake-take-over-recovery.md
  • server/take-over.contract.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@devswha

devswha commented Oct 29, 2026

Copy link
Copy Markdown
Owner Author

Merging 6df94b3. Test-only: in server/take-over.contract.test.ts the displaced attach in the 'consumes a click when the running ordinary retry succeeds' case holds its "taken over" line well past its exit, as #2373 did for the ordinary-failure case, so a busy runner cannot pass the line on before the exit comes. Diff read by the merge pass; no CodeRabbit review needed.

@devswha
devswha merged commit a819842 into main Oct 29, 2026
19 checks passed
@devswha
devswha deleted the test/take-over-displacement-hold branch October 29, 2026 22:26
@devswha devswha mentioned this pull request Oct 30, 2026
devswha added a commit that referenced this pull request Oct 30, 2026
## Release 0.4.21

The release PR, prepared by step 1 of
[docs/development.md#releasing](https://github.com/devswha/ovis/blob/main/docs/development.md#releasing),
now re-folded on main `1ef6ea329108a0985b823e8235b03daddcd0a5f4` after
the owner held 0.4.21 for more work. The merge pass reported the 0.4.21
queue empty.

**Do not merge yet:** the owner judges the final build before release.
No tag and no Release run from this PR's author.

- **Version:** `version` is 0.4.21 in `package.json` and
`herdr-plugin.toml`.
- **Changelog:** `bun scripts/changelog-fold.ts 0.4.21 2026-10-30`
folded 63 fragments into the 2026-10-30 section of `CHANGELOG.md` (71
entries), linked their PRs and deleted the fragments; `changelog.d`
holds only `README.md`.
- `by @login` on every outside contributor's PR link: #2361 @eddieparc,
#2333 @IdrisGit, #2355 @imurfutur3, #2341 @sulthonzh, #2359 @YuuuXie,
#2377 @IdrisGit, #2269 @CharleoYang, #2405 @jpcarranza94, #2414
@homebodify, #2417 @cheol-95, #2418 @eddieparc, #2435 @cheol-95.
- Two outside PRs had no fragment and got an entry by hand: #2341
(OpenCode background commands, Added) and #2359 (installer test timing,
Maintenance).
- Issue reporters are credited in their entries: @blaker3115-Agri
(#1488), @Hyd3-14 (#2026), @osamahbeig (#2343), @Shunamxiao (#2329),
@matiemer (#2362), @kilhyeonjun (#2344), @eddieparc (#2360), @Ploppy3
(#2236), @sulthonzh (#2340), @WOULDU-pres (#2056), @odfalik (#2038),
@aNNdii (#511), @Noobear (#2281, fixed by #2424); #2435 fixes
@cheol-95's own #2434.
- Two fragments ran past the changelog's width (#2418, #2269); their
entries are re-wrapped, words unchanged. #2382's entry reads "OpenCode's
installer puts its folder first" (reviewed earlier on this PR).
- Maintainer PRs without a fragment and without a user-facing change
have no entry: #2353 (check tool), #2371 (guide docs), #2396 and #2397
(tests), #2403 and #2433 (server and client transport seams, no
behaviour change), #2437 (test-only fix for #2435's check). #2438's own
entry (the sidebar selection marked by its fill again) is dropped: the
stroke #2352 added never shipped, so users see no change; #2352's entry
keeps only the Windows high-contrast Highlight bar.
- **Release summaries:** en, ko, ja and zh each have 5 new, 5 improved
and 5 fixed lines. Since the first review: New lists the in-browser
Claude Code / Codex sign-in (#2428) in place of the tab/workspace
shortcut line; Improved lists Settings → Agents (#2427) in place of the
sidebar fold line; Fixed lists the Codex wrong-session fix (#2426,
#2430) in place of the phone screenshot paste line. The Artifacts and
Claude status-line lines keep their reviewed wording (turned on in
Settings). Not in 0.4.21: #2420 (Codex chat behind Kiro), #2065 (Portal
sign-in) and #2436 (relay foundations) stay open for a later release.
- **Remote bundle:** `REMOTE_BUNDLE_VERSION` rises from 39 to 40 because
the bundle inputs (`server/`, `shared/`, `patches/`) changed since
remote-v39. After merge: push `remote-v40` on the merged commit and wait
for the Remote PC bundles workflow before running Release.
- **iOS:** `CURRENT_PROJECT_VERSION` stays 3 (#2370 changed
`Info.plist`; build 3 is not known to be uploaded yet).

## Validation

- `bun scripts/release-guards.ts --base v0.4.20`: "Release 0.4.21:
remote bundle, telemetry Worker and release metadata are in order."
- `dori heavy … bun run check fast` on this branch: workflow syntax,
generated types and themes, typecheck, build, unit tests all ok. Unit:
9166 pass, 0 fail, 36 skip in 591 files.
- Every PR in `v0.4.20..main` was pre-run for the owner's hands-on guide
on isolated copies (own herdr session, fresh state, never the owner's
live session). Items that need a real device (iPhone tap dictation
#2370, dictation keyboards #2386, the installed desktop app's title-bar
overlay #2381) are left for the owner's final check.

This is a release-metadata PR: it changes no code path. Per the release
steps, merge it after CI and the owner's go, then push `remote-v40`,
wait for its bundles, and run Release with `0.4.21`.
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