Skip to content

[compound-engineering] Bug: /test-browser hardcodes localhost:3000, ignores project port config #164

@likeahoss

Description

@likeahoss

Bug Description

Component: Command - /test-browser
Summary: /test-browser hardcodes localhost:3000 as the dev server URL. Projects that use a different port (e.g., port 5000 due to firewall constraints in WSL) get ECONNREFUSED every time browser tests run. The command should detect the dev server port from project configuration (CLAUDE.md, package.json scripts, etc.) or accept a port override argument.

Environment

  • Plugin Version: 2.30.0 (git: 5febbf1)
  • Claude Code Version: 2.1.37
  • OS: Linux (WSL2) 6.6.87.2-microsoft-standard-WSL2

What Happened

When /test-browser is invoked (either standalone or via /compound-engineering:workflows:review), agent-browser navigates to http://localhost:3000. In projects where the dev server runs on a different port (port 5000 in this case), the connection is refused and all browser tests fail.

Expected Behavior

/test-browser should:

  1. Read the project's dev server port from CLAUDE.md, vite.config.ts, package.json scripts, or similar project config
  2. Accept an optional port/URL argument (e.g., /test-browser --port 5000 or /test-browser --url http://localhost:5000)
  3. Fall back to localhost:3000 only if no project-specific port is detected

Steps to Reproduce

  1. Have a project with dev server configured on port 5000 (documented in CLAUDE.md as a key convention)
  2. Run /compound-engineering:workflows:review or /test-browser directly
  3. Accept the "Want to run browser tests?" prompt
  4. agent-browser attempts to connect to http://localhost:3000
  5. Connection refused — all tests fail

Error Messages

ECONNREFUSED - could not connect to localhost:3000

Additional Context

  • The project's CLAUDE.md explicitly documents Port 5000: Required for dev/preview — only non-firewalled port in WSL environment
  • The test-browser.md command template hardcodes port 3000 in multiple places (lines 132, 157, 165)
  • Workaround: Added a CLAUDE.md instruction Browser tests (/test-browser): Use http://localhost:5000 (not 3000) — but agents don't always follow this since the command template overrides it

Reported via /report-bug command

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions