Query server API for iw status instead of reading cache file #250

Merged
mprihoda merged 4 commits from wip/status-server-query into main 2026-03-12 08:38:46 +00:00
mprihoda commented 2026-03-12 08:38:40 +00:00 (Migrated from github.com)

Summary

  • Add GET /api/v1/worktrees/:issueId/status endpoint that assembles WorktreeStatus from live filesystem data (git, review state, progress) and cached API data (issue, PR)
  • Add ServerClient.getWorktreeStatus() to call the new endpoint with proper error handling (server not running, worktree not found)
  • Simplify status.scala from ~100 lines to ~50 by delegating to the server instead of reading state.json cache directly
  • Add IW_SERVER_PORT env var for test isolation

Test plan

  • Unit tests: WorktreeStatus JSON round-trip serialization (4 tests)
  • E2E tests: server not running, server disabled, bad args, branch inference (4 tests)
  • All existing unit tests pass
  • All 32 commands compile
  • Manual: iw status with running server shows live data

🤖 Generated with Claude Code

## Summary - Add `GET /api/v1/worktrees/:issueId/status` endpoint that assembles `WorktreeStatus` from live filesystem data (git, review state, progress) and cached API data (issue, PR) - Add `ServerClient.getWorktreeStatus()` to call the new endpoint with proper error handling (server not running, worktree not found) - Simplify `status.scala` from ~100 lines to ~50 by delegating to the server instead of reading `state.json` cache directly - Add `IW_SERVER_PORT` env var for test isolation ## Test plan - [x] Unit tests: WorktreeStatus JSON round-trip serialization (4 tests) - [x] E2E tests: server not running, server disabled, bad args, branch inference (4 tests) - [x] All existing unit tests pass - [x] All 32 commands compile - [ ] Manual: `iw status` with running server shows live data 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No description provided.