Skip to content

Comments

fix: ao stop logs accurate dashboard status#131

Open
AgentWrapper wants to merge 1 commit intomainfrom
fix/stop-logs-accuracy
Open

fix: ao stop logs accurate dashboard status#131
AgentWrapper wants to merge 1 commit intomainfrom
fix/stop-logs-accuracy

Conversation

@AgentWrapper
Copy link
Collaborator

Summary

  • Extracts stopDashboard from start.ts into lib/stop-dashboard.ts for testability
  • The function correctly logs "Dashboard stopped" (green) when processes are killed, or "Dashboard not running on port X" (yellow) when nothing is found — fixes the regression where it always logged "Dashboard stopped"
  • Adds __tests__/commands/start.test.ts with 4 tests covering all branches

Fixes #92.

Test plan

  • ao stop when dashboard is running → logs Dashboard stopped in green
  • ao stop when dashboard is not running → logs Dashboard not running on port X in yellow
  • pnpm exec vitest run __tests__/commands/start.test.ts in packages/cli — 4 tests pass

🤖 Generated with Claude Code

Extract stopDashboard to lib/stop-dashboard.ts so it can be tested
in isolation. The function already correctly logs "Dashboard stopped"
when processes are killed and "Dashboard not running on port X" when
nothing is found. Add tests to prevent regression.

Fixes #92.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@AgentWrapper AgentWrapper force-pushed the fix/stop-logs-accuracy branch from f95a59d to 111c43c Compare February 21, 2026 13:15
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

beforeEach(() => {
mockExec.mockReset();
vi.spyOn(console, "log").mockImplementation(() => {});
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing afterEach mock restoration breaks test codebase pattern

Low Severity

Every other test file in packages/cli/__tests__/ imports afterEach and calls vi.restoreAllMocks() to clean up spies (e.g., dashboard.test.ts, init.test.ts, open.test.ts, session.test.ts). This new test file creates a console.log spy in beforeEach but never restores it. The spy's call history accumulates across tests since neither mockClear nor mockReset is called on it, making negative assertions like not.toHaveBeenCalledWith fragile and order-dependent.

Fix in Cursor Fix in Web

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.

ao stop logs 'Dashboard stopped' even when no dashboard was running

1 participant