You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(dev): honor explicit --port literally instead of silently offsetting by runtime index (#1079) (#1661)
* fix(dev): honor explicit --port literally instead of silently offsetting by runtime index
When running multiple `agentcore dev` runtimes, an explicit -p/--port was
silently offset by the runtime's index in agentcore.json (basePort + index),
so `agentcore dev -r AgentB -p 8788` bound 8789 with no explanation. Clients
targeting http://localhost:<-p>/invocations silently hit the wrong port.
Use Commander's getOptionValueSource to distinguish explicit vs default -p:
honor an explicit --port literally across the --logs, web-ui, and TUI paths;
when -p is implicit (default), keep the index offset but log it (mirroring the
existing findAvailablePort shift message) and document it in --help. invoke
continues to target whatever port the server bound, made consistent with the
chosen server semantics.
Scope: Surgical, unit-test-verified. tsc --noEmit clean, eslint clean (no new
warnings), 1002/1002 unit tests pass across src/cli/operations/dev and
src/cli/tui including the updated and new getAgentPort tests. The only failing
tests (4 in dev.test.ts) are pre-existing CLI-spawn failures that fail
identically on the clean baseline (require a built dist; environmental,
unrelated to this change). The web-ui path is a structurally multi-agent
server, so for the explicit -p case the SELECTED runtime binds exactly -p while
concurrently-served runtimes are offset relative to it -- the minimal way to
honor explicit -p there without redesigning the multi-agent port model.
* fix(dev): honor explicit --port literally instead of silently offsetting by runtime index (#1079)
* style(dev): format command.tsx fixedPort ternary with prettier
* fix(dev): fail fast on explicit --port conflict, clarify offset log, instrument port_explicit
- throw/error instead of silently rebinding when an explicit -p is taken across
the --logs, TUI, and web-ui start paths (the silent-shift behavior #1079 removes)
- reword the implicit-offset log to name the runtime index and how to override
(no longer implies a port conflict)
- web-ui: honor explicit -p literally only for the selected runtime; other
runtimes keep the default uiPort+1+index allocation (no ports below the base)
- extract resolveAgentTargetPort and unit-test it
- add optional port_explicit telemetry attr to DevAttrs
0 commit comments