Skip to content

feat(dev): per-worktree serve port and a preview tab - #6

Merged
Lenoux01 merged 1 commit into
mainfrom
feat/orca-preview
Sep 9, 2026
Merged

Lenoux01 merged 1 commit into
mainfrom
feat/orca-preview

Conversation

@Lenoux01

@Lenoux01 Lenoux01 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Why

nextup serve defaults to 4177 — and on the mac that port is held permanently by the LaunchAgent dev.hansenexus.nextup-serve. I verified it was holding the port while writing this. So an Orca lane on the default doesn't just risk colliding with a sibling lane; it fights the machine's own long-running server.

What

  • scripts/dev-port.sh — slot per worktree (0–15, stable path hash, probes past claimed slots); port is 4177 + slot*100. Main checkout stays slot 0 = 4177, which is right: lanes aren't the main checkout, and the LaunchAgent's port isn't one a lane should ever take.
  • On-demand preview tab: prints this lane's URL and the serve command, boots nothing.

Verified

Live lane, not a desk check:

check result
lane slot port 5677
bun cli.ts serve --port 5677 came up, /harness listed
curl that port 200
4177 throughout still the LaunchAgent's, untouched
shellcheck clean
check-orca-yaml.sh ok … setup archive issueCommand defaultTabs(3)

That last one is worth noting: this is the first time this repo's orca.yaml has been through Orca's own parser. It was stamped by the setup-repo skill but the repo was never registered with Orca, so nothing had ever verified it — and a parse error silently disables every hook. It parses clean, and its existing tab commands (lint, typecheck, test) all exist in package.json.

Registering the repo on both Orca runtimes is a separate step, done outside this PR.

🤖 Generated with Claude Code

`nextup serve` defaults to 4177 — and on the mac that port is held permanently
by the LaunchAgent dev.hansenexus.nextup-serve. So an Orca lane running the
default does not just risk colliding with a sibling lane; it fights the
machine's own long-running server. Verified the LaunchAgent was holding 4177
while writing this.

scripts/dev-port.sh gives each worktree a slot (0..15, stable hash of its
absolute path, probing past slots siblings already claimed); the port is
`4177 + slot*100`. The main checkout stays slot 0 = 4177, which is correct:
lanes are not the main checkout, and the LaunchAgent's port is not something a
lane should ever take.

The `preview` tab is on-demand — it prints this lane's URL and the serve command
and boots nothing.

Verified in a live lane: it resolved 5677, `bun cli.ts serve --port 5677` came
up and answered 200, and the LaunchAgent kept 4177 untouched throughout.
shellcheck clean; orca.yaml validated with
hn-infra/scripts/orca/check-orca-yaml.sh (defaultTabs(3)) — the first time this
file has been run through Orca's own parser, since the repo was never registered.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Lenoux01
Lenoux01 merged commit 11850eb into main Sep 9, 2026
3 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