Fix clogged up git operations.

This commit is contained in:
Greyson Parrelli
2026-08-27 13:32:47 -04:00
parent 2e3af19d00
commit d7452c2262
9 changed files with 315 additions and 51 deletions
+11 -5
View File
@@ -23,11 +23,17 @@ That variable is the whole of the addressing. It names **this tab's** review, so
there is no repository to pass and no way to address comments meant for another
worktree.
Give every call a deadline — `--max-time 30`. The server runs `git` for some of
these, and a repository being built in another pane can make that slow; a curl
with no deadline turns that into a tool timeout that says nothing about what
went wrong. If one does trip, say so and try once more rather than treating it
as a missing review: the answer was late, not absent.
If it is empty — you are running outside playpen, or in a shell started before
the server came up — discover it instead:
```bash
curl -s http://127.0.0.1:8420/api/tabs
curl -s --max-time 30 http://127.0.0.1:8420/api/tabs
```
That lists every tab with the `path` it is reviewing. Match `path` against
@@ -40,7 +46,7 @@ stop.
Confirm the review is open:
```bash
curl -s "$BASE/api/repo"
curl -s --max-time 30 "$BASE/api/repo"
```
- `{"open":true,…}` — good, go on.
@@ -50,7 +56,7 @@ curl -s "$BASE/api/repo"
## 2. Fetch the pending comments
```bash
curl -s "$BASE/api/review/pending"
curl -s --max-time 30 "$BASE/api/review/pending"
```
Returns this review's submitted, unresolved comments. Each has:
@@ -88,7 +94,7 @@ For every pending comment, in order:
3. **Post an inline reply** describing exactly what you did (or your answer):
```bash
curl -s -X POST "$BASE/api/comments/<id>/replies" \
curl -s --max-time 30 -X POST "$BASE/api/comments/<id>/replies" \
-H 'Content-Type: application/json' \
-d '{"body":"Done — main() now logs and returns the error instead of printing.","author":"claude"}'
```
@@ -96,7 +102,7 @@ For every pending comment, in order:
4. **Resolve the thread** once it's fully handled (skip if you asked a question):
```bash
curl -s -X POST "$BASE/api/comments/<id>/resolve"
curl -s --max-time 30 -X POST "$BASE/api/comments/<id>/resolve"
```
Replies and resolutions appear in the review pane immediately over its live
+13 -6
View File
@@ -21,19 +21,26 @@ job, and your comments land in its queue automatically (see step 7).
```bash
BASE="$PLAYPEN_REVIEW_URL" # e.g. http://127.0.0.1:8420/t/tab3
curl -s "$BASE/api/repo"
curl -s --max-time 30 "$BASE/api/repo"
```
`$PLAYPEN_REVIEW_URL` is exported into every terminal pane and names **this
tab's** review, so there is nothing to choose and no way to leave your review on
someone else's branch.
Give every call a deadline — `--max-time 30`. The server runs `git` for some of
these, and a repository being built in another pane can make that slow; a curl
with no deadline turns that into a tool timeout that says nothing about what
went wrong. If one does trip, say so and try once more rather than treating it
as a missing review: the answer was late, not absent.
- `{"open":true,…}` with a `context` object — good, go to step 2.
- `{"open":false}` or a 409 — this tab has no review pane. Tell the user to open
one (**Ctrl+Shift+D**) and stop. Don't review a different tab.
- `$PLAYPEN_REVIEW_URL` empty, or connection refused — list the tabs with
`curl -s http://127.0.0.1:8420/api/tabs` and match a tab's `path` against
`git rev-parse --show-toplevel`. If nothing matches, stop and say so.
`curl -s --max-time 30 http://127.0.0.1:8420/api/tabs` and match a tab's
`path` against `git rev-parse --show-toplevel`. If nothing matches, stop and
say so.
## 2. Find out which diff to review
@@ -59,7 +66,7 @@ whose line numbers the pane can place a comment on.
## 3. Get the diff
```bash
curl -s "$BASE/api/diff?base=main&uncommitted=true"
curl -s --max-time 30 "$BASE/api/diff?base=main&uncommitted=true"
```
The `patch` field is the exact bytes the pane renders, and `files` is the
@@ -163,7 +170,7 @@ Three details that decide whether a comment lands where you meant:
**Don't repeat what's already been said.** Fetch the existing threads first:
```bash
curl -s "$BASE/api/comments"
curl -s --max-time 30 "$BASE/api/comments"
```
Skip anything the user already raised, and anything **you** raised on an earlier
@@ -192,7 +199,7 @@ Write each body like a comment in a thread someone has to read:
## 6. Post them
```bash
curl -s -X POST "$BASE/api/comments" -H 'Content-Type: application/json' -d '{
curl -s --max-time 30 -X POST "$BASE/api/comments" -H 'Content-Type: application/json' -d '{
"level":"line","file":"src/review/Store.zig","side":"new","line":84,"endLine":91,
"author":"claude",
"body":"Should fix: save() runs while the write lock is held, so a slow disk blocks every reader for the length of the write. Snapshot the list under the lock and write outside it."