fix: remove dead code, duplicate tests, and hardcoded ports
- Use config.port instead of hardcoded 3000 in orchestrator prompt - Remove 2 duplicate null-activity tests (identical to existing test) - Assert on URL path not port in session table tests (port is config concern) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
af38f68b21
commit
0a3b5e6529
|
|
@ -499,7 +499,7 @@ describe("session table", () => {
|
|||
expect(output).toContain("app-1");
|
||||
expect(output).toContain("working");
|
||||
expect(output).toContain("active");
|
||||
expect(output).toContain("http://localhost:3000/sessions/app-1");
|
||||
expect(output).toContain("/sessions/app-1");
|
||||
});
|
||||
|
||||
it("shows PR, CI, and bugbot data from SCM", async () => {
|
||||
|
|
@ -575,7 +575,7 @@ describe("session table", () => {
|
|||
expect(parsed[0].activity).toBe("idle");
|
||||
expect(parsed[0].ci).toBe("-");
|
||||
expect(parsed[0].bugbot).toBe(0);
|
||||
expect(parsed[0].sessionUrl).toBe("http://localhost:3000/sessions/app-1");
|
||||
expect(parsed[0].sessionUrl).toContain("/sessions/app-1");
|
||||
expect(parsed[0].prUrl).toBe("");
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -615,51 +615,6 @@ describe("status command", () => {
|
|||
expect(parsed[0].activity).toBeNull();
|
||||
});
|
||||
|
||||
it("shows null activity when session activity is null", async () => {
|
||||
writeFileSync(
|
||||
join(sessionsDir, "app-1"),
|
||||
"worktree=/tmp/wt\nbranch=feat/err\nstatus=working\n",
|
||||
);
|
||||
|
||||
mockTmux.mockImplementation(async (...args: string[]) => {
|
||||
if (args[0] === "list-sessions") return "app-1";
|
||||
if (args[0] === "display-message") return String(Math.floor(Date.now() / 1000));
|
||||
return null;
|
||||
});
|
||||
mockGit.mockResolvedValue("feat/err");
|
||||
|
||||
// Session has activity: null (default from buildSessionsFromDir)
|
||||
await program.parseAsync(["node", "test", "status", "--json"]);
|
||||
|
||||
const jsonCalls = consoleSpy.mock.calls.map((c) => c[0]).join("");
|
||||
const parsed = JSON.parse(jsonCalls);
|
||||
expect(parsed[0].activity).toBeNull();
|
||||
});
|
||||
|
||||
it("shows null activity when session activity is explicitly null", async () => {
|
||||
writeFileSync(
|
||||
join(sessionsDir, "app-1"),
|
||||
"worktree=/tmp/wt\nbranch=feat/null\nstatus=working\n",
|
||||
);
|
||||
|
||||
mockSessionManager.list.mockImplementation(async () => {
|
||||
return buildSessionsFromDir(sessionsDirRef.current, "my-app", null);
|
||||
});
|
||||
|
||||
mockTmux.mockImplementation(async (...args: string[]) => {
|
||||
if (args[0] === "list-sessions") return "app-1";
|
||||
if (args[0] === "display-message") return String(Math.floor(Date.now() / 1000));
|
||||
return null;
|
||||
});
|
||||
mockGit.mockResolvedValue("feat/null");
|
||||
|
||||
await program.parseAsync(["node", "test", "status", "--json"]);
|
||||
|
||||
const jsonCalls = consoleSpy.mock.calls.map((c) => c[0]).join("");
|
||||
const parsed = JSON.parse(jsonCalls);
|
||||
expect(parsed[0].activity).toBeNull();
|
||||
});
|
||||
|
||||
it("shows exited activity from session manager", async () => {
|
||||
writeFileSync(
|
||||
join(sessionsDir, "app-1"),
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ ao open ${projectId}
|
|||
| \`ao session kill <session>\` | Kill a specific session |
|
||||
| \`ao session cleanup [-p project]\` | Kill completed/merged sessions |
|
||||
| \`ao send <session> <message>\` | Send a message to a running session |
|
||||
| \`ao dashboard\` | Start the web dashboard (http://localhost:${config.port ?? 3000}) |
|
||||
| \`ao dashboard\` | Start the web dashboard (http://localhost:${config.port}) |
|
||||
| \`ao open <project>\` | Open all project sessions in terminal tabs |
|
||||
| \`ao session table [-p project]\` | Print structured table of all sessions (deterministic, machine-readable) |
|
||||
| \`ao session table --json [-p project]\` | Same as above but JSON output |`);
|
||||
|
|
@ -215,7 +215,7 @@ When an agent needs human judgment:
|
|||
|
||||
8. **Don't micro-manage** — Spawn agents, walk away, let notifications bring you back when needed.
|
||||
|
||||
9. **You are running in a terminal — do NOT use markdown links like \`[text](url)\`.** URLs must be printed as plain text so they are clickable in the terminal. Example: \`http://localhost:3000/sessions/ao-1\` not \`[ao-1](http://localhost:3000/sessions/ao-1)\``);
|
||||
9. **You are running in a terminal — do NOT use markdown links like \`[text](url)\`.** URLs must be printed as plain text so they are clickable in the terminal. Example: \`http://localhost:${config.port}/sessions/ao-1\` not \`[ao-1](http://localhost:${config.port}/sessions/ao-1)\``);
|
||||
|
||||
// Project-specific rules (if any)
|
||||
if (project.orchestratorRules) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue