Skip to content

Refuse a HERDR_BIN_PATH that names nothing executable before the daemon starts - #200

Merged
yansfil merged 1 commit into
mainfrom
fix/stale-herdr-bin-path
Sep 27, 2026
Merged

yansfil merged 1 commit into
mainfrom
fix/stale-herdr-bin-path

Conversation

@yansfil

@yansfil yansfil commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Summary

2026-09-27 18:59 the Electron hide.app replaced the Swift bundle under a running Herdr server, and herdr moved from Resources/herdr-runtime/herdr to Resources/herdr.
The server keeps handing every new pane the path it started from, so a hided started from inside a pane inherited a dead HERDR_BIN_PATH, came up healthy, and failed every pane attach with spawn_failed; the app showed every pane as "unavailable · click to retry" with the cause only in core.jsonl.
The daemon now refuses a HERDR_BIN_PATH that names nothing executable before it binds or writes state, and hide connect refuses the same value before spawning, answering start_failed with the path instead of a ten-second no_response.
A missing binary stays the logged degraded state, and a Workspace command still never checks it, since it never runs herdr.

Review

  • 판단해 주세요: 데스크톱 호스트의 D-07(환경이 herdr를 지정하면 그대로 통과)은 그대로 두었습니다. pane 안에서 앱을 띄우면 이제 "failed" 화면과 경로가 나오고, Finder에서 띄우면 번들 herdr로 정상 동작합니다. 존재하지 않는 경로일 때 호스트가 번들 herdr로 대체하는 쪽이 낫다고 보시면 별도 PR로 하겠습니다.
  • 조심해서 볼 파일: hided/src/env.rs - load_from은 그대로 관대하고(herdr_bin_path_wins_over_path_lookup이 존재하지 않는 경로로 Ok를 기대), 검사는 herdr_bin_error로 분리해 데몬 시작과 spawn 직전에만 호출합니다. failure path.
  • 조심해서 볼 파일: hided/src/lib.rs start_daemon - lock, state file, bind보다 앞에서 거부해 죽은 pid를 가리키는 state file을 남기지 않습니다.

Evidence

  • 확인한 것: cargo test -p hided 전체 통과(lib 102, handshake 22, opener 10), 새 단위 테스트 1개(없는 경로 -> 경로가 담긴 오류, 실행 가능 파일 -> None, 바이너리 없음 -> None); verify-cargo.sh lint 경고 없음.
  • 확인한 것: 디버그 hide connect에 없는 경로를 주면 {"ok":false,"reason":"start_failed","detail":"HERDR_BIN_PATH: <path> is not an executable file; …"} exit 2, state dir에 아무것도 남지 않음; hided 직접 실행도 같은 메시지로 exit 2.
  • 확인한 것: 대조군으로 번들 herdr와 격리 소켓(HERDR_SOCKET_PATH를 없는 경로로)에서 hide connect가 데몬을 띄우고 hide stop으로 내려감, 잔류 프로세스 없음.
  • 확인하지 못한 것: 데스크톱 앱이 stale pane 환경에서 실행될 때 "failed" 화면에 detail이 어떻게 보이는지는 실제 앱으로 재현하지 않았습니다(parseConnect가 start_failed+detail로 읽는 것은 기존 테스트 cli.test.ts가 증명).
  • 확인하지 못한 것: 운영 서버는 이 PR 밖에서 server.live_handoff로 새 번들 경로로 넘길 예정이라, 실제 pane 환경이 고쳐지는 것은 이 PR이 아니라 그 작업이 증명합니다.

AI tooling: 대부분 AI 도구. 로그의 spawn_failed 원인과 ps eww의 HERDR_BIN_PATH, 재시작 후 terminal.session_ready를 손으로 대조했습니다.

…on starts

Herdr hands every pane the path its server started from, and that path
died when the Electron bundle replaced the Swift one under the running
server (Resources/herdr-runtime/herdr became Resources/herdr). A hided
started inside a pane inherited the old value, came up healthy, and then
failed every pane attach with spawn_failed, so the app showed every pane
as unavailable with the cause only in the core log.

The daemon now refuses that value before it binds or writes state, and
hide connect refuses it before spawning as start_failed with the path,
instead of a ten-second no_response that names nothing. A missing binary
stays the logged degraded state; a Workspace command still never checks
it, since it never runs herdr.
@yansfil
yansfil merged commit 7a02951 into main Sep 27, 2026
6 checks passed
@yansfil
yansfil deleted the fix/stale-herdr-bin-path branch September 27, 2026 11:20
yansfil added a commit that referenced this pull request Oct 28, 2026
…dows shell never draws (#1810)

Closes with-hide/hide-private#200
Related: with-hide/hide-private#116, with-hide/hide-private#117,
with-hide/hide-private#154, with-hide/hide-private#312

## Summary

Linux desktop nightly가 매일 실패하던 원인을 고치고, Windows web e2e에서 첫 화면이 안 그려지는
flaky의 원인을 다음 실패에서 알 수 있게 기록합니다.
- #200: Herdr 화면에는 줄바꿈 표시가 없어서, 줄 끝까지 꽉 찬 주소는 다음 줄 첫 단어로 이어진다고 읽습니다.
Linux에서는 이 테스트의 pane이 정확히 29칸이고 `http://127.0.0.1:PORT/a.html`도 29자라, 다음
줄 `osc8`이 주소에 붙었습니다. 주소 다음 줄을 비워 폰트 폭과 무관하게 했습니다.
- #116, #117(같은 증상 #123 #133 #146 #217): Windows에서 shell이나 프로젝트 줄이 20초
안에 안 그려집니다. 남은 증거로 원인을 확정하지 못해 이 PR에서 닫지 않습니다. `enterWorkspace`의 대기가
실패하면 페이지 상태, 각 요청의 응답, 응답 없이 끝난 요청(최대 32개, Chromium의 이유 포함)을 failure
dump로 남깁니다. 통과한 테스트는 아무것도 출력하지 않습니다.
- #154: #1650(4fc9b8c)이 이미 고쳤습니다. 이후 flaky 3건은 모두 그 수정이 없는 커밋이고 10-24
이후 재발이 없어, 근거와 함께 이슈를 닫았습니다.

## Review

- **판단해 주세요**: #200의 제품 동작은 이 PR에서 고치지 않았습니다. 꽉 찬 URL 뒤에 상관없는 줄이 오면
운영자에게도 틀린 링크가 열리지만, 화면 격자만으로는 진짜 줄 넘김과 구분할 수 없습니다(이어지는 조각도 URL 문자로 시작).
Herdr는 `recent_unwrapped`로 그 사실을 알고 있어서, 그것을 링크 판단까지 가져오는 일을
with-hide/hide-private#312로 남겼습니다.
- **판단해 주세요**: #116/#117은 원인 수정이 아니라 진단 추가입니다. 분석은 #116, #117 코멘트에 있습니다.
- **조심해서 볼 파일**: `web/e2e/wire.ts` - 모든 web spec이 지나는 길입니다. 대기를 감싸기만 하고
timeout, 재시도, 단언은 그대로입니다.
- **조심해서 볼 파일**: `web/e2e/failure-dump.ts` - 실패한 요청 기록은 페이지마다 32개 상한이고
페이지가 닫히면 버립니다. 주소의 hash에 daemon token이 있어서 경로만 기록합니다.

## Evidence

- **확인한 것**: 10-27 nightly 스크린샷(`terminal-url-menu.png`)에서 주소가 pane 오른쪽
끝에 정확히 닿고 다음 줄이 `osc8`로 시작합니다. 수정 전 9회 nightly가 모두 두 시도에서 받은 값
`.../a.htmlosc8`로 실패했습니다.
- **확인한 것**: 361a08faa에서 nightly `lane=linux`를 두 번
dispatch했습니다(40718149961, 40718546910). 두 번 모두 desktop e2e linux 19/19
통과, 고친 테스트 첫 시도 통과, flaky 없음입니다.
- **확인한 것**: 같은 커밋의 PR verify(40718258556)가 통과했습니다. 고친 테스트는 macOS와
Windows desktop e2e에서도 첫 시도에 통과했고, desktop·web e2e 모든 shard에 flaky가
없었습니다.
- **확인한 것**: 9d7fd7c(실패 요청 버퍼)는 web e2e eslint, 타입 검사, `playwright
test --list`(387 tests)가 통과했습니다. CI는 이 커밋에서 다시 돕니다.
- **확인하지 못한 것**: 로컬 desktop e2e는 돌리지 못했습니다. 디스크 여유가 759 MiB라 debug
build가 불가능해 실행 근거는 모두 CI입니다.
- **확인하지 못한 것**: #116/#117의 원인. 다음 Windows 실패의 `[failure dump] shell
start` / `project row` 줄이 근거가 됩니다.

<details><summary>Verification record</summary>

- Base: `8915cb3d8878` (origin/main at branch start)
- Heads: `361a08faa` (spec fix and dump), `9d7fd7c38` (failed requests
kept for the dump only)
- Nightly dispatch `lane=linux` on 361a08f: run 40718149961 success;
run 40718546910 desktop e2e nightly-linux success. Both: `✓
terminal-links.spec.ts:420:5 ... @platform`, `19 passed`, `no flaky test
in this run`.
- PR verify 40718258556 on 361a08f: success. desktop e2e macOS 1/2 and
2/2, windows desktop, web e2e linux 1-6/6, web e2e windows: each `no
flaky test in this run`.
- Before the fix: nightly runs 39158794370 through 40586138794 (9)
failed `terminal-links.spec.ts` on both tries with `Received:
".../a.htmlosc8"`.
- Local on 9d7fd7c: `eslint e2e/wire.ts e2e/failure-dump.ts` exit 0;
`tsc --noEmit --strict` on both files exit 0; `playwright test --list`
387 tests in 119 files.
- #154: last flaky comment 2026-10-23T19:16Z on commits without
4fc9b8c; main 115b63c run 40706855580 desktop e2e macos 2/2 `ok 72
new-tab.spec.ts:130`.

</details>
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