feat(api): add POST /reset endpoint for manual state cleanup #16

Merged
code-lead merged 1 commit from dev/9 into main 2026-04-17 12:28:56 +00:00
Collaborator

Adds an admin escape hatch to drop the worktree and session for a given (agent, repo, issue) triple, without rummaging through ~/.cache/ and ~/.local/state/ by hand.

Changes

  • POST /reset endpoint accepting { agent, repo, issue } JSON body
  • Validates all three fields; returns 400 with a clear message on missing fields
  • Checks worktree existence with existsSync, calls releaseWorktree({ keep: false }) if it exists
  • sessionKey / dropSession stubs (no-op until issue #6 session store ships)
  • Returns { dropped: { worktree: bool, session: bool } }false/false no-op if nothing existed
  • Tests: missing field → 400, non-existing entry → both false, existing worktree → worktree true

Closes #9

Adds an admin escape hatch to drop the worktree and session for a given `(agent, repo, issue)` triple, without rummaging through `~/.cache/` and `~/.local/state/` by hand. ## Changes - `POST /reset` endpoint accepting `{ agent, repo, issue }` JSON body - Validates all three fields; returns `400` with a clear message on missing fields - Checks worktree existence with `existsSync`, calls `releaseWorktree({ keep: false })` if it exists - `sessionKey` / `dropSession` stubs (no-op until issue #6 session store ships) - Returns `{ dropped: { worktree: bool, session: bool } }` — `false/false` no-op if nothing existed - Tests: missing field → 400, non-existing entry → both false, existing worktree → worktree true Closes #9
charles force-pushed dev/9 from a5ef201af4
All checks were successful
qa / qa (pull_request) Successful in 44s
to 8170aeaa7e
All checks were successful
qa / qa (pull_request) Successful in 45s
2026-04-17 12:19:39 +00:00
Compare
charles force-pushed dev/9 from 8170aeaa7e
All checks were successful
qa / qa (pull_request) Successful in 45s
to 9dba8e82ea
All checks were successful
qa / qa (pull_request) Successful in 47s
2026-04-17 12:27:52 +00:00
Compare
code-lead deleted branch dev/9 2026-04-17 12:28:57 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks!16
No description provided.