Skip to content

fix(tui): use the intended core and desktop server from the launcher - #4702

Closed
devswha wants to merge 4 commits into
mainfrom
fix/tui-launch-targets
Closed

devswha wants to merge 4 commits into
mainfrom
fix/tui-launch-targets

Conversation

@devswha

@devswha devswha commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

What broke

ovis tui could use the default session instead of Herdr's plugin configuration, pass a relative socket into a screen started from another directory, or pass SSH X11 forwarding to a core it starts. The desktop launcher could use the wrong session or contact an unrelated Ovis server that reused a stopped app's port.

Reproduction and fix

  • In an isolated PTY, point Herdr at a non-default session and then use a relative Unix socket. Both cases failed to reach the intended core before the fix and opened the test pane after it.
  • Launcher fixtures pin the core environment, the desktop session, and the stopped-app case (one request before the fix, zero after). The launcher shares plugin-config lookup, resolves socket paths from the invoking shell, drops SSH X11 forwarding only for a core it starts, and passes the desktop app's own session.
  • The desktop command verifies the recorded app process and its listener before contacting the port; the server withdraws its listener record before shutdown frees the port. Older desktop launchers still validate the record, and standalone ovis tui and its help do not depend on the desktop HTTP listener. New process records work across app and shell time zones.

Validation

  • Launcher, core environment, and desktop-command targeted regressions: 197 passed, 1 Windows-only skip. Final timezone-focused rerun: 47 passed, 1 Windows-only skip.
  • Both isolated PTY probes passed after the fix. Native macOS and Windows were not exercised.
  • Re-ran bun run check fast with a shorter TMPDIR and six unit workers. Workflow syntax, generated-file checks, typecheck, and build passed; the unit stage reached the 510-second command deadline (exit 124) without a reported assertion failure before interruption. The prior run hit an unrelated account-matrix timeout. Main CI's Fast checks also failed in account tests. Publishing with that validation gap per the lead's decision.
  • After the review fixes: 196 focused tests passed (one Windows-only skip); bun run typecheck and bun run build passed on the final code.

Review notes

Codex reviewed 672d07e8a3c0f47f12be74bd70c053fe7f3ad51c once. Fixed all three reproduced medium findings: shutdown port reuse, standalone TUI dispatch being gated by desktop HTTP liveness, and validation being skipped by a pre-upgrade launcher. Remaining low-severity observation: lexical normalization can change the meaning of .. immediately following a symlink in a relative core-socket path.

Closes #4577
Closes #4576
Closes #4561
Closes #4463
Refs #4460 (partly: the remaining gaps are listed on the issue)

@coderabbitai

coderabbitai Bot commented Nov 25, 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 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 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 b0f20e7 and 1869a75.

Files selected for processing: 14

  • app/electron/src/children.ts
  • app/electron/src/main.ts
  • app/electron/src/terminalCommand.astra-launcher.test.ts
  • app/electron/src/terminalCommand.test.ts
  • app/electron/src/terminalCommand.ts
  • changelog.d/tui-launch-targets.md
  • scripts/plugin-settings.ts
  • scripts/plugin-tui.test.ts
  • scripts/plugin-tui.ts
  • scripts/plugin.ts
  • server/desktop-listener.ts
  • server/herdr-core/core-env.test.ts
  • server/herdr-core/core-env.ts
  • server/index.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

@devswha

devswha commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #4725

@devswha devswha closed this Nov 25, 2026
devswha added a commit that referenced this pull request Nov 25, 2026
…xture (#4725)

## Changes

- [#4701 — Preserve last-pane
history](#4701). In an isolated
core, a picker jump from a zoomed pane returned `layout_conflict`: the
screen stayed on `t2`, but the previous-pane history changed to `t1`.
Preserve history through the tentative focus change and intervening
refresh; record the pane left only after confirmation. Codex reviewed
`478825873`; its reproduced refresh finding was fixed in `0ed0033cc`.
[CodeRabbit was
rate-limited](#4701 (comment)).

  Closes #4519

- [#4702 — Use the intended launcher
target](#4702). Isolated PTY probes
reproduced the wrong core with a non-default Herdr plugin session and a
relative socket; launcher fixtures reproduced inherited SSH X11
settings, the wrong desktop session, and one request to an unrelated
listener after the app stopped. Share plugin-config lookup, resolve the
socket relative to the calling shell, drop forwarded X11 settings only
for a newly started core, and verify the desktop server record and
listener before using its port. Codex reviewed `672d07e8a`; its three
reproduced findings (shutdown port reuse, standalone TUI gating, and
legacy launcher validation) were fixed in `1869a756c`. [CodeRabbit was
rate-limited](#4702 (comment)).

  Closes #4577  
  Closes #4576  
  Closes #4561  
  Closes #4463  
  Refs #4460 (partly: the remaining gaps are listed on the issue)

Bundle follow-up `e5f6cad72` restores the desktop `start`/`stop`
guidance that the new listener check masked. These commands do not
contact the server; commands that use its port still require a valid
listener record.

- [#4703 — Synchronize the stop-and-continue
fixture](#4703). An isolated Linux
child-subreaper probe found seven launcher/screen pairs left behind in
80 runs on main. Wait for the screen itself to stop before `fg`, then
let the launcher reap the screen and Bash reap the launcher. Production
code is unchanged by this source PR. Codex reviewed `c42d2c2f7`; its
reproduced teardown finding was fixed in `52553fac1`. [CodeRabbit was
rate-limited](#4703 (comment)).

  Closes #4562

Supersedes #4701 #4702 #4703

## Validation

- Linux: 14 focused zoom and last-pane tests passed; 197 launcher tests
passed (one Windows-only case skipped); all 30 terminal-restoration PTY
tests passed.
- The real `ovis tui` entry rendered an isolated test pane and detached
in both PTY probes: a non-default session discovered through the Herdr
plugin and a relative core socket.
- The stop-and-continue regression passed 40 repeats; the isolated
process-group check passed 60 repeats.
- `bun run typecheck` and `git diff --check origin/main...HEAD` passed.
- The existing desktop lifecycle regression failed on the initial bundle
and passed after `e5f6cad72`. The first fast run also hit an unrelated
SSH Unix-socket path-length failure; all three tests in
`server/ssh-account-add.test.ts` passed with a shorter `TMPDIR`.
- `bun run check fast` passed on `e5f6cad72` with the shorter `TMPDIR`:
27,969 unit tests passed, 0 failed, 247 skipped.
- Native macOS and Windows were not exercised.

---------

Co-authored-by: sisyphus-dev-ai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant