feat: isolate dev environment for multi-agent worktree support#1994
feat: isolate dev environment for multi-agent worktree support#1994
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Knip - Unused Code Analysis🔴 +1 change in total issues (0 on main → 1 on PR)
DetailsUnused devDependencies
What is this?Knip finds unused files, dependencies, and exports in your codebase. Run |
PR ReviewThis is a dev-tooling-only PR (no production code changes). The server runs only locally, so security severity is reduced accordingly.
✅ Path traversal in |
E2E Test Results✅ All tests passed • 101 passed • 3 skipped • 1008s
Tests ran across 4 shards in parallel. |
|
Did a quick quick test - one question - is it intentional that the docker volumes are not shared - when I ran |
It really depends on your worktree setup. If you want the volume to be shared, make sure to add the copy step to your wt pre-create hook. |
88708db to
e9d4e0a
Compare
This doesn't seem to work.. I tried again. I tried on Didn't explore the code - lmk if you want me to investigate more |
Think about it again. I'm not sure copying .volume is a good idea since the session or db states might be corrupted. Alternatively, we can setup a dev only flag to enable auto signup. |
Add slot-based port isolation so multiple git worktrees can run the full dev stack simultaneously without port conflicts. - Compute deterministic slot (0-99) from worktree directory name - Allocate dev ports in 30100-31199 range (no overlap with CI or E2E) - Parameterize docker-compose.dev.yml ports, project name, and volumes - Add Docker labels (hdx.dev.*) for portal service discovery - Remove fluentd logging driver from dev compose - Add dev portal microservice (localhost:9900) with live log streaming - Add make dev, make dev-down, make dev-portal targets - Tee local service logs to ~/.config/hyperdx/dev-slots/<slot>/logs/ - Update development docs with isolation workflow and port table
Reduce initial log payload sizes, batch DOM updates via rAF with a 5000-line cap, and convert ANSI escape codes to styled HTML for proper color rendering in the log viewer.
Register alerts and common-utils as local services in the dashboard so each concurrently process gets its own clickable log viewer.
Launch the portal server automatically when sourcing dev-env.sh. Skips if port 9900 is already in use (another worktree started it first). The portal process is cleaned up on exit alongside slot files.
… keybinding, plain port text - Use exact HyperDX dark mode color palette from _tokens.scss - Replace placeholder logo with HyperDX logomark SVG - Add favicon from packages/app - Expand instance cards to full width - Add Escape keybinding to close log panel - Make yarn dev mirror make dev (both source dev-env.sh) - Port numbers in table are now plain text, not clickable links
Use conditional tee (${HDX_DEV_LOGS_DIR:+path}) so app:dev writes log
files when the env var is set (via dev-env.sh) and passes through to
stdout when it's not. Single source of truth for which services are
launched.
…onflict Set NEXT_DIST_DIR=.next-e2e in E2E playwright config so the E2E Next.js dev server uses a different build/lock directory than the main dev server, allowing both to run simultaneously from the same worktree.
… failures - dev-env.sh: remove stale .next/dev/lock before starting (preserves cache) - test-e2e.sh: remove entire .next-e2e directory for a clean slate each run
…e, log capture - Dev portal now discovers E2E (e2e-<slot>) and CI integration (int-<slot>) Docker containers alongside dev stacks, grouped by worktree in one card - Moved E2E tests to dedicated port range (20320-21399) so they no longer conflict with CI integration tests (14320-40098) or dev stack (30100-31199) - Added stdout log capture for make dev-e2e (tee to logs-e2e/e2e.log) and make dev-int (tee to logs-int/api-int.log) for portal log streaming - Local service port probing for E2E (API, App) and CI (API) processes - Auto-start dev portal from make dev-int and make dev-e2e via shared ensure-dev-portal.sh script - Added make dev-portal-stop and make dev-clean now stops portal + wipes ~/.config/hyperdx/dev-slots - Fixed stale E2E default ports across all E2E test files
- Logs are now archived to history/<envType>-<timestamp>/ on exit instead of being deleted, so devs can revisit past run logs - Added History tab to dev-portal with worktree-grouped cards matching the Live view layout - History API: GET /api/history (list), GET /api/history/:slot/:dir/:file (read), DELETE /api/history/:slot/:dir (remove) - Custom dark-themed confirm modal replaces native browser confirm() for Delete and Clear All actions - make dev-clean still wipes everything including history - Makefile uses reusable archive-int-logs function for DRY cleanup
- Write meta.json alongside archived logs with worktree/branch/path so history entries retain correct identity after the originating dev stack shuts down and its slot JSON file is deleted - Fix discoverHistory() fallback: only use process.cwd() for the local slot, inherit worktree info from sibling meta.json files for other slots - Add global search in History tab filtering by worktree and branch name - History cards collapsed by default, with expand/collapse toggle button in the top-right corner of each card - Search resets expanded state so all cards fold when typing
8447e74 to
842fea2
Compare
Summary
Port Isolation
hdx-dev-<slot>e2e-<slot>int-<slot>All three can run simultaneously from the same worktree with zero port conflicts.
Dev Portal Features
Live tab:
make dev,make dev-e2e,make dev-intHistory tab:
~/.config/hyperdx/dev-slots/<slot>/history/on exit (instead of deleted)meta.jsonwith worktree/branch metadataWhat Changed
scripts/dev-env.sh— Slot-based port assignments, portal auto-start, log archival on exitscripts/test-e2e.sh— E2E port range (20320-21399), log capture viatee, portal auto-start, log archivalscripts/ensure-dev-portal.sh— Shared singleton portal launcher (works sourced or executed)scripts/dev-portal/server.js— Discovery for dev/E2E/CI containers, history API (list/read/delete), local service port probingscripts/dev-portal/index.html— Live/History tabs, worktree-grouped cards, search, collapse/expand, custom confirm modal, ANSI color log renderingdocker-compose.dev.yml— Parameterized ports/volumes/project name withhdx.dev.*labelspackages/app/tests/e2e/docker-compose.yml— Updated to new E2E port defaultsMakefile—dev-int/dev-e2etargets with log capture + portal auto-start;dev-portal-stop;dev-cleanstops everything + wipes slot data.envfiles — Ports use${VAR:-default}syntax across dev, E2E, and CI environmentsagent_docs/development.md— Full documentation for isolation, port tables, E2E/CI port rangesHow to Use
Dev Portal
Test Plan
make dev— verify services start with slot-assigned portsmake devin a second worktree — verify different ports, no conflictsmake dev-e2eandmake dev-intsimultaneously — no port conflictsmake dev-clean— stops everything, wipes slot data and history