Context from my IDE setup:
Active file: README.md
Active selection of the file:
Solver-backed
Open tabs:
- README.md: README.md
- AGENTS.md: AGENTS.md
- page.tsx: apps/web/src/app/page.tsx
- page.tsx: apps/web/src/app/hands/page.tsx
- site-metadata.ts: apps/web/src/lib/site-metadata.ts
My request for Codex:
Goal:
Review your recently changed files for code reuse, quality, and efficiency issues, then fix them.
Run the Playwright test, debug any failures, fix the real root cause, and keep going until the test passes reliably.
Important working rules:
- First identify the root problem before changing code
- Do not guess
- Inspect the repo and existing Playwright setup first
- Reuse existing Playwright config, helpers, fixtures, auth state, selectors, and test utilities if they already exist
- Make sure not to patch the code, but to solve it with clear, simple, and robust logic
- Prefer real product fixes over test-only hacks
- Do not add brittle sleeps unless there is no better option
- Do not commit or push
What I want you to do
Phase 1: Inspect
- Inspect the repo structure
- Find:
- Playwright config
- existing e2e tests
- auth setup / storage state
- helper utilities
- run commands
- relevant app routes and components used by the failing flow
- Identify the exact test to run and any required local assumptions
Phase 2: Run the test
- Run the relevant Playwright test
- Capture:
- test output
- failing step
- screenshots
- trace if available
- console errors
- network failures
- Do not start editing until you understand the failure
Phase 3: Debug the root cause
- Determine whether the failure is caused by:
- broken product logic
- stale or missing test selectors
- async race condition
- worker / API / queue issue
- auth / session issue
- incorrect test assumption
- Fix the actual source of truth
- Do not patch around the bug with weak waits or fragile selectors unless absolutely necessary
Phase 4: Re-run and stabilize
- Re-run the failing Playwright test
- If it still fails, continue debugging
- Repeat until it passes consistently
- If needed, run the test more than once to confirm stability
Technical expectations
- Use stable selectors
- Prefer role, label, test id, or existing semantic selectors
- If selectors are missing, add the minimum stable selectors needed
- If there is a timing issue, wait on real state changes, not arbitrary delays
- If backend state is wrong, fix backend logic instead of masking it in the test
- If a worker / queue / analysis pipeline is involved, inspect that flow too
Use Playwright MCP to test the website end to end:
- open the app
- click through the relevant pages
- reproduce the failing flow
- verify the fix in the real UI
Validation
After fixing, run:
- the relevant Playwright test again
- any nearby targeted unit/integration tests affected by the fix
- anything else needed to confirm there is no obvious regression
Output format
- Root cause
- Files changed
- Tests run
- Final result
- Any remaining risks
Critical instruction
Do not stop at a superficial pass.
The task is only done when the Playwright test passes and the underlying issue is fixed with clear, simple, and robust logic.