High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.
docs: the paused-tab helper's comment claims every page-mutating endpoint calls it and endpoints.md promises 409 for /actions and /macro, but both refuse per item inside a 200 (PIN-179)
Luigi Agostif1d9553a37c0
diff --git a/docs/endpoints.md b/docs/endpoints.mdindex 9bd8c015..b95738a7 100644--- a/docs/endpoints.md+++ b/docs/endpoints.md@@ -114,7 +114,14 @@ Notes:- `POST /tabs/{id}/handoff` marks the tab as `paused_handoff` and records a reason- `GET /tabs/{id}/handoff` returns the current handoff state, or `active` when no handoff is set- `POST /tabs/{id}/resume` clears the handoff state and can carry resume metadata for the caller-- a paused-handoff tab is a hard block on the action-execution routes (`/action`, `/actions`, `/macro`): they return `409 tab_paused_handoff` until `/resume` clears the state+- a paused-handoff tab blocks the action-execution routes, but the two envelopes differ.+ `POST /action` returns `409` with code `tab_paused_handoff` and a `details.hint` naming+ `/resume`. `POST /actions` and `POST /macro` return **200** — they answer with a result+ list — and refuse per item: the entry for each step against the paused tab has+ `success: false` and a message naming the pause, with no code of its own yet. With+ `stopOnError` false (the default) the remaining steps still run, so each step aimed at the+ paused tab is refused the same way while steps naming another tab execute normally.+ `/resume` clears the state for all of them.- treat the handoff record as coordination state, not as a security boundary — non-action endpoints (snapshots, screenshots, network logs, evals subject to their own gates) remain reachable- CLI wrappers exist: `pinchtab handoff`, `pinchtab resume`, `pinchtab handoff-status`, plus the `pinchtab tab handoff|resume|handoff-status` aliasesdiff --git a/internal/handlers/handoff.go b/internal/handlers/handoff.goindex a3c0bbde..c9e0eadc 100644--- a/internal/handlers/handoff.go+++ b/internal/handlers/handoff.go@@ -66,10 +66,16 @@ func (h *Handlers) enforceTabNotPausedForHandoff(tabID string) error {return fmt.Errorf("tab %s is paused for human handoff", tabID)}-// enforceTabNotPausedForHandoffOrRespond is the single writer of the paused-tab-// refusal: every endpoint that mutates what the human is looking at calls it, so-// a client sees one status, code and remedy hint regardless of which one it hit.-// Reports ok=false once the 409 has been written.+// enforceTabNotPausedForHandoffOrRespond is the single writer of the RESPONSE-LEVEL+// paused-tab refusal: an endpoint that answers with one status calls it, so a client+// sees the same 409, code and remedy hint whichever it hit. Reports ok=false once the+// 409 has been written.+//+// It is NOT every page-mutating endpoint. POST /actions and POST /macro answer 200 with+// a result list, so a status written from inside their loop would describe the wrong+// thing; they call the raw predicate above and carry the condition as a per-item result,+// which today is a bare message with no code and no hint. Giving that shape its own+// writer beside this one is PIN-179.func (h *Handlers) enforceTabNotPausedForHandoffOrRespond(w http.ResponseWriter, tabID string) bool {err := h.enforceTabNotPausedForHandoff(tabID)if err == nil {