Skip to content

fix: keep the dev shell out of the daily driver's runtime file#101

Merged
omartelo merged 1 commit into
mainfrom
fix/dev-runtime-isolation
Jul 26, 2026
Merged

fix: keep the dev shell out of the daily driver's runtime file#101
omartelo merged 1 commit into
mainfrom
fix/dev-runtime-isolation

Conversation

@omartelo

Copy link
Copy Markdown
Owner

The bug

runChromium records runtime.json before the LICH_DEV_URL branch, so every task dev run wrote its own port and
token into the daily driver's runtime file — and deleted that file on its clean exit (defer os.Remove(path)). Two
casualties: install.sh could no longer reach the running daily driver for /restart, and a second daily-driver
launch stopped recognising itself as a duplicate, dying with a bare bind error instead of focusing the open window.

The fix

singleton.path now gates the filename on LICH_DEV, mirroring store.databasePath and logging.fileName:
runtime-dev.json for a task dev shell, runtime.json for the daily driver.

The gate lives at the shared path rather than at the call site because Write, Read and Detect all route through
path — one guard covers the write, the read and the exit-time removal, and the dev shell's duplicate detection now
finds its own instance (on 47822) instead of reading the daily driver's record and mistaking a live app for a dead
port. install.sh keeps reading runtime.json and keeps finding the real instance.

No CHANGELOG.md entry: the bug is reachable only through task dev, so no user of a published version lived it.

Test plan

  • TestDevSplit covers both halves of the bug: a dev Write leaves the daily record intact, and removing the path
    dev was handed (what main.go defers) leaves runtime.json standing.
  • go test ./... — 405 passed in 19 packages.
  • go vet ./... and gofmt -l . clean.
  • Cross-compile loop for linux, darwin and windows builds and vets clean.

runChromium records runtime.json before the LICH_DEV_URL branch, so a
`task dev` run overwrote the daily driver's coordinates and removed the
file on its own clean exit. LICH_DEV now selects runtime-dev.json,
mirroring the store's database split, so Write, Read and Detect all
route through the same per-shell path.
@omartelo
omartelo merged commit c58e5c2 into main Jul 26, 2026
3 checks passed
@omartelo
omartelo deleted the fix/dev-runtime-isolation branch July 26, 2026 02:03
@omartelo omartelo mentioned this pull request Jul 26, 2026
2 tasks
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