Skip to content

Fix .port file path resolution in dev mode#36

Merged
DorianZheng merged 1 commit intomainfrom
fix/port-file-path-dev-mode
Mar 20, 2026
Merged

Fix .port file path resolution in dev mode#36
DorianZheng merged 1 commit intomainfrom
fix/port-file-path-dev-mode

Conversation

@DorianZheng
Copy link
Copy Markdown
Collaborator

Summary

  • Centralizes portFilePath in config.ts using backendPackageRoot so the .port file path is consistent across all consumers
  • Fixes a regression from ca0780d where agent-manager.ts resolved join(__dirname, '../.port') to src/.port instead of packages/backend/.port in dev mode, causing DUNE_WS_URL to not be set for agents

Test plan

  • make build passes
  • Run make dev, start an agent, verify DUNE_WS_URL is set in the agent's environment
  • Verify packaged app still resolves the port correctly (config.port takes precedence)

ca0780d changed getBackendPort() to read join(__dirname, '../.port'),
which resolves correctly from dist/index.js but incorrectly from
src/agents/agent-manager.ts (one level too deep → src/.port instead of
packages/backend/.port). Centralize portFilePath in config.ts using
backendPackageRoot so both server.ts and agent-manager.ts always
resolve to the same path regardless of source layout.
@DorianZheng DorianZheng merged commit d1c74b4 into main Mar 20, 2026
1 check failed
@DorianZheng DorianZheng deleted the fix/port-file-path-dev-mode branch March 20, 2026 20:35
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