diff --git a/agent-orchestrator.yaml.example b/agent-orchestrator.yaml.example index 99daf79e6..58339691d 100644 --- a/agent-orchestrator.yaml.example +++ b/agent-orchestrator.yaml.example @@ -8,7 +8,7 @@ dataDir: ~/.agent-orchestrator worktreeDir: ~/.worktrees # Web dashboard port -port: 3000 +port: 4100 # Terminal server ports (defaults: 14800/14801 — chosen to avoid conflicts with dev tools) # Override when running multiple dashboards to avoid EADDRINUSE diff --git a/packages/cli/__tests__/commands/init.test.ts b/packages/cli/__tests__/commands/init.test.ts index 7f530fd38..42a6b033d 100644 --- a/packages/cli/__tests__/commands/init.test.ts +++ b/packages/cli/__tests__/commands/init.test.ts @@ -37,7 +37,7 @@ describe("init command", () => { expect(existsSync(outputPath)).toBe(true); }); - it("auto mode uses port 3000 when it is available", async () => { + it("auto mode uses port 4100 when it is available", async () => { tmpDir = mkdtempSync(join(tmpdir(), "ao-init-test-")); const outputPath = join(tmpDir, "agent-orchestrator.yaml"); @@ -50,17 +50,17 @@ describe("init command", () => { await program.parseAsync(["node", "test", "init", "--auto", "--output", outputPath]); const content = readFileSync(outputPath, "utf-8"); - expect(content).toContain("port: 3000"); + expect(content).toContain("port: 4100"); }); - it("auto mode picks next free port when 3000 is occupied", async () => { + it("auto mode picks next free port when 4100 is occupied", async () => { tmpDir = mkdtempSync(join(tmpdir(), "ao-init-test-")); const outputPath = join(tmpDir, "agent-orchestrator.yaml"); - // Occupy port 3000 + // Occupy port 4100 const blocker = createServer(); await new Promise((resolve) => { - blocker.listen(3000, "127.0.0.1", () => resolve()); + blocker.listen(4100, "127.0.0.1", () => resolve()); }); try { @@ -73,14 +73,14 @@ describe("init command", () => { await program.parseAsync(["node", "test", "init", "--auto", "--output", outputPath]); const content = readFileSync(outputPath, "utf-8"); - // Should NOT be 3000 since we're occupying it - expect(content).not.toContain("port: 3000"); - // Should pick 3001 (or higher if 3001 is also taken) + // Should NOT be 4100 since we're occupying it + expect(content).not.toContain("port: 4100"); + // Should pick 4101 (or higher if 4101 is also taken) const portMatch = content.match(/port: (\d+)/); expect(portMatch).toBeTruthy(); const port = parseInt(portMatch![1], 10); - expect(port).toBeGreaterThan(3000); - expect(port).toBeLessThan(3100); + expect(port).toBeGreaterThan(4100); + expect(port).toBeLessThan(4200); } finally { await new Promise((resolve) => blocker.close(() => resolve())); } diff --git a/packages/cli/__tests__/commands/open.test.ts b/packages/cli/__tests__/commands/open.test.ts index e05481233..719c2a98d 100644 --- a/packages/cli/__tests__/commands/open.test.ts +++ b/packages/cli/__tests__/commands/open.test.ts @@ -34,7 +34,7 @@ beforeEach(() => { mockConfigRef.current = { dataDir: "/tmp/ao", worktreeDir: "/tmp/wt", - port: 3000, + port: 4100, defaults: { runtime: "tmux", agent: "claude-code", diff --git a/packages/cli/__tests__/commands/review-check.test.ts b/packages/cli/__tests__/commands/review-check.test.ts index 13a5843b5..e63b92392 100644 --- a/packages/cli/__tests__/commands/review-check.test.ts +++ b/packages/cli/__tests__/commands/review-check.test.ts @@ -113,7 +113,7 @@ beforeEach(() => { mockConfigRef.current = { configPath, - port: 3000, + port: 4100, defaults: { runtime: "tmux", agent: "claude-code", diff --git a/packages/cli/__tests__/commands/session.test.ts b/packages/cli/__tests__/commands/session.test.ts index ba44da863..aa6620675 100644 --- a/packages/cli/__tests__/commands/session.test.ts +++ b/packages/cli/__tests__/commands/session.test.ts @@ -124,7 +124,7 @@ beforeEach(() => { mockConfigRef.current = { configPath, - port: 3000, + port: 4100, defaults: { runtime: "tmux", agent: "claude-code", diff --git a/packages/cli/__tests__/commands/spawn.test.ts b/packages/cli/__tests__/commands/spawn.test.ts index 594f2de86..bbe09d353 100644 --- a/packages/cli/__tests__/commands/spawn.test.ts +++ b/packages/cli/__tests__/commands/spawn.test.ts @@ -72,7 +72,7 @@ beforeEach(() => { mockConfigRef.current = { configPath, - port: 3000, + port: 4100, defaults: { runtime: "tmux", agent: "claude-code", diff --git a/packages/cli/__tests__/commands/status.test.ts b/packages/cli/__tests__/commands/status.test.ts index e3e77eb37..c91853fc1 100644 --- a/packages/cli/__tests__/commands/status.test.ts +++ b/packages/cli/__tests__/commands/status.test.ts @@ -170,7 +170,7 @@ beforeEach(() => { mockConfigRef.current = { configPath, - port: 3000, + port: 4100, readyThresholdMs: 300_000, defaults: { runtime: "tmux", diff --git a/packages/cli/__tests__/lib/plugins.test.ts b/packages/cli/__tests__/lib/plugins.test.ts index 04defd512..a2d717999 100644 --- a/packages/cli/__tests__/lib/plugins.test.ts +++ b/packages/cli/__tests__/lib/plugins.test.ts @@ -9,7 +9,7 @@ function makeConfig( return { dataDir: "/tmp", worktreeDir: "/tmp/wt", - port: 3000, + port: 4100, defaults: { runtime: "tmux", agent: defaultAgent, workspace: "worktree", notifiers: [] }, projects: Object.fromEntries( Object.entries(projects ?? { app: {} }).map(([id, p]) => [ diff --git a/packages/cli/__tests__/lib/session-utils.test.ts b/packages/cli/__tests__/lib/session-utils.test.ts index 4a3f2ac39..f6f967d2e 100644 --- a/packages/cli/__tests__/lib/session-utils.test.ts +++ b/packages/cli/__tests__/lib/session-utils.test.ts @@ -60,7 +60,7 @@ describe("findProjectForSession", () => { ({ dataDir: "/tmp", worktreeDir: "/tmp/wt", - port: 3000, + port: 4100, defaults: { runtime: "tmux", agent: "claude-code", workspace: "worktree", notifiers: [] }, projects: Object.fromEntries( Object.entries(projects).map(([id, p]) => [ diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index 17c54e256..8f43ab5f3 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -13,7 +13,7 @@ import { formatProjectTypeForDisplay, } from "../lib/project-detection.js"; -const DEFAULT_PORT = 3000; +const DEFAULT_PORT = 4100; const MAX_PORT_SCAN = 100; /** Find the first available port starting from `start`, scanning upward. */ diff --git a/packages/core/src/__tests__/lifecycle-manager.test.ts b/packages/core/src/__tests__/lifecycle-manager.test.ts index eb6a9efd1..17a09d80a 100644 --- a/packages/core/src/__tests__/lifecycle-manager.test.ts +++ b/packages/core/src/__tests__/lifecycle-manager.test.ts @@ -114,7 +114,7 @@ beforeEach(() => { config = { configPath, - port: 3000, + port: 4100, defaults: { runtime: "mock", agent: "mock-agent", diff --git a/packages/core/src/__tests__/plugin-integration.test.ts b/packages/core/src/__tests__/plugin-integration.test.ts index 209883fc2..42edf0896 100644 --- a/packages/core/src/__tests__/plugin-integration.test.ts +++ b/packages/core/src/__tests__/plugin-integration.test.ts @@ -160,7 +160,7 @@ beforeEach(() => { config = { configPath, - port: 3000, + port: 4100, defaults: { runtime: "mock", agent: "mock-agent", diff --git a/packages/core/src/__tests__/session-manager.test.ts b/packages/core/src/__tests__/session-manager.test.ts index 96d56edff..3c6b85efa 100644 --- a/packages/core/src/__tests__/session-manager.test.ts +++ b/packages/core/src/__tests__/session-manager.test.ts @@ -87,7 +87,7 @@ beforeEach(() => { config = { configPath, - port: 3000, + port: 4100, defaults: { runtime: "mock", agent: "mock-agent", diff --git a/packages/core/src/config.ts b/packages/core/src/config.ts index 4a4c34070..cf1cc13b1 100644 --- a/packages/core/src/config.ts +++ b/packages/core/src/config.ts @@ -89,7 +89,7 @@ const DefaultPluginsSchema = z.object({ }); const OrchestratorConfigSchema = z.object({ - port: z.number().default(3000), + port: z.number().default(4100), terminalPort: z.number().optional(), directTerminalPort: z.number().optional(), readyThresholdMs: z.number().nonnegative().default(300_000), diff --git a/packages/integration-tests/src/cli-spawn-core-read-new.integration.test.ts b/packages/integration-tests/src/cli-spawn-core-read-new.integration.test.ts index 6c1b3f791..4bc778c2a 100644 --- a/packages/integration-tests/src/cli-spawn-core-read-new.integration.test.ts +++ b/packages/integration-tests/src/cli-spawn-core-read-new.integration.test.ts @@ -59,7 +59,7 @@ describe.skipIf(!tmuxOk)("CLI-Core integration (hash-based architecture)", () => // Create config WITHOUT dataDir/worktreeDir (new architecture) const config = { - port: 3000, + port: 4100, defaults: { runtime: "tmux", agent: "claude-code", @@ -155,7 +155,7 @@ describe.skipIf(!tmuxOk)("CLI-Core integration (hash-based architecture)", () => // Create session-manager with configPath const config: OrchestratorConfig = { configPath, // This enables hash-based architecture - port: 3000, + port: 4100, readyThresholdMs: 300_000, defaults: { runtime: "tmux", @@ -215,7 +215,7 @@ describe.skipIf(!tmuxOk)("CLI-Core integration (hash-based architecture)", () => const config: OrchestratorConfig = { configPath, - port: 3000, + port: 4100, readyThresholdMs: 300_000, defaults: { runtime: "tmux", diff --git a/packages/integration-tests/src/config-metadata-service.integration.test.ts b/packages/integration-tests/src/config-metadata-service.integration.test.ts index bff3cee0c..6db37bac6 100644 --- a/packages/integration-tests/src/config-metadata-service.integration.test.ts +++ b/packages/integration-tests/src/config-metadata-service.integration.test.ts @@ -36,7 +36,7 @@ describe("config → metadata service integration (real filesystem)", () => { // Create a minimal config file const config = { - port: 3000, + port: 4100, defaults: { runtime: "tmux", agent: "claude-code", diff --git a/packages/integration-tests/src/terminal-web.integration.test.ts b/packages/integration-tests/src/terminal-web.integration.test.ts index db1914846..90adecc11 100644 --- a/packages/integration-tests/src/terminal-web.integration.test.ts +++ b/packages/integration-tests/src/terminal-web.integration.test.ts @@ -56,13 +56,13 @@ describe("terminal-web integration", () => { }); describe("URL construction", () => { - it("default dashboard URL uses port 3000", async () => { + it("default dashboard URL uses port 4100", async () => { const logSpy = vi.spyOn(console, "log").mockImplementation(() => {}); const terminal = webPlugin.create(); await terminal.openSession(makeSession({ id: "url-test" })); expect(logSpy).toHaveBeenCalledWith( - expect.stringContaining("http://localhost:3000/sessions/url-test/terminal"), + expect.stringContaining("http://localhost:4100/sessions/url-test/terminal"), ); }); diff --git a/packages/plugins/terminal-web/src/index.test.ts b/packages/plugins/terminal-web/src/index.test.ts index 4a4843368..49ba85f08 100644 --- a/packages/plugins/terminal-web/src/index.test.ts +++ b/packages/plugins/terminal-web/src/index.test.ts @@ -72,7 +72,7 @@ describe("terminal-web", () => { const terminal = create(); await terminal.openSession(makeSession()); - expect(logSpy).toHaveBeenCalledWith(expect.stringContaining("http://localhost:3000")); + expect(logSpy).toHaveBeenCalledWith(expect.stringContaining("http://localhost:4100")); }); it("uses custom dashboard URL", async () => { diff --git a/packages/plugins/terminal-web/src/index.ts b/packages/plugins/terminal-web/src/index.ts index 9cbf808c4..ff1c96e84 100644 --- a/packages/plugins/terminal-web/src/index.ts +++ b/packages/plugins/terminal-web/src/index.ts @@ -16,7 +16,7 @@ export const manifest = { * that the dashboard needs. */ export function create(config?: Record): Terminal { - const dashboardUrl = (config?.dashboardUrl as string) ?? "http://localhost:3000"; + const dashboardUrl = (config?.dashboardUrl as string) ?? "http://localhost:4100"; // Track which sessions have been "opened" (URL generated for the dashboard) const openSessions = new Set(); diff --git a/packages/web/src/__tests__/api-routes.test.ts b/packages/web/src/__tests__/api-routes.test.ts index 9bae0f315..aab936a4a 100644 --- a/packages/web/src/__tests__/api-routes.test.ts +++ b/packages/web/src/__tests__/api-routes.test.ts @@ -127,7 +127,7 @@ const mockRegistry: PluginRegistry = { const mockConfig: OrchestratorConfig = { configPath: "/tmp/ao-test/agent-orchestrator.yaml", - port: 3000, + port: 4100, readyThresholdMs: 300_000, defaults: { runtime: "tmux", agent: "claude-code", workspace: "worktree", notifiers: [] }, projects: { @@ -166,7 +166,7 @@ import { GET as eventsGET } from "@/app/api/events/route"; function makeRequest(url: string, init?: RequestInit): NextRequest { return new NextRequest( - new URL(url, "http://localhost:3000"), + new URL(url, "http://localhost:4100"), init as ConstructorParameters[1], ); }