Skip to content

test: unit mode never falls back to the user's herdr - #482

Merged
devswha merged 1 commit into
mainfrom
fix/unit-tests-no-live-herdr
Oct 5, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/unit-tests-no-live-herdr

Conversation

@devswha

@devswha devswha commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Change

Agents in other panes kept leaving test panes under Needs you in the live web UI: exec '/tmp/herdr-web-ui-prompt-…' cards in the INPUT state, plus stray herdr-web-ui-test-omo-* / codex-binding-* workspaces in the user's herdr session.

Cause: agents run HERDR_TEST_MODE=unit bun test with no file list as "the unit tests". A bare bun test also loads every *.contract.test.ts. In unit mode scripts/test-herdr.ts returned early without setting HERDR_SOCKET, so herdrSocketPath() fell back to ~/.config/herdr/herdr.sock, the user's own session. The contract tests then created their workspaces there, and prompt.contract.test.ts reported its stand-in claude menus as blocked. A run that was cut short also skipped afterAll, so its workspaces stayed.

Fix:

  • In unit mode, scripts/test-herdr.ts points HERDR_SOCKET at a socket that does not exist ($TMPDIR/herdr-web-ui-unit-tests-have-no-herdr.sock). A contract file loaded in a unit run now fails with cannot reach herdr instead of working in the user's herdr. Integration mode and HERDR_TEST_LIVE=1 are unchanged.
  • AGENTS.md names bun run test:unit as the unit suite and says why a bare unit-mode bun test fails.

No changelog entry: nothing users of the app notice changes.

Validation

  • bun run typecheck: clean.
  • bun run test:unit: 119 files, 1375 pass, 4 skip, 0 fail.
  • HERDR_TEST_MODE=unit bun test ./server/prompt.contract.test.ts: 0 pass, 1 fail with HerdrError: cannot reach herdr at /tmp/herdr-web-ui-unit-tests-have-no-herdr.sock. The live session's workspace list and the herdr server log showed no new workspace afterwards. Before the fix, the same kind of run created herdr-web-ui-test-* workspaces in the live session (seen in its server log and herdr workspace list).

A bare `HERDR_TEST_MODE=unit bun test` also loads every *.contract.test.ts.
In unit mode the test-herdr preload set no HERDR_SOCKET, so those files
fell back to the default socket and opened their workspaces and stand-in
agents (the prompt test's blocked `claude` menus among them) in the herdr
the user works in, where they showed under Needs you.

Unit mode now points HERDR_SOCKET at a socket that does not exist, so such
a run fails with "cannot reach herdr" instead. AGENTS.md names
`bun run test:unit` as the unit suite.
@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0c41ebae-e26d-4954-8f77-1de29d9733eb
📥 Commits

Reviewing files that changed from the base of the PR and between e3f1789 and 863ead1.

📒 Files selected for processing (2)
  • AGENTS.md
  • scripts/test-herdr.ts
 ___________________________________________________________
< Ultimately, we're all just debugging someone else's code. >
 -----------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@devswha
devswha merged commit ef8f9ea into main Oct 5, 2026
3 of 4 checks passed
@devswha
devswha deleted the fix/unit-tests-no-live-herdr branch October 5, 2026 22:36
devswha added a commit that referenced this pull request Oct 6, 2026
Its branch had appended the tab-strip sentence to the fonts entry under
[0.3.50], which was released before #479 merged. The sentence is its own
entry under [0.3.51] Fixed, and the 0.3.50 entry links #473 alone again.

Bumps package.json and herdr-plugin.toml to 0.3.51 and moves the
Unreleased notes under [0.3.51] - 2026-10-06, with the compare link. Raises the
remote PC bundle to 18: #368 adds the `take-over` capability the bridge
advertises, and #477, #483, #484, #485 and #486 change what the bridge reads
(transcripts, prompts, process start times, a pane's Codex store), so a
remote PC on bundle 17 keeps the old behaviour until its bridge is updated.
Push the `remote-v18` tag and let the bundle workflow publish before
running release.yml.

Carries #368 #477 #479 #481 #482 #483 #484 #485 #486 #487

Co-Authored-By: Claude Fable 5.1 <[email protected]>
aNNdii added a commit to aNNdii/herdr-web-ui that referenced this pull request Oct 6, 2026
…-comments-inline-next

Brings upstream main up to b1ebe18 (devswha#482–devswha#500) onto next together with the
comment cards. Conflicts resolved: Markdown.tsx imports take next's memo/useId
and upstream's useEffect; CHANGELOG keeps next's devswha#429 entries and adds
upstream's new Added and Changed entries.
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