You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- In Docker (`GOG_ACCOUNT` set): run ONE curl per exec call, check result in your context, then poll again. Do NOT use a bash while loop. You are the loop controller.
140
-
- In non-Docker: the `/wait` call blocks until state changes, then process the result.
140
+
After each poll result:
141
+
- If `pageStatus.stopMonitoring` is `true` → **stop immediately** (user clicked Stop Monitoring)
142
+
- If `status` is `"completed"` → read result and stop
143
+
- If `status` is `"rewriting"` → handle the retry request (see Step 4), then poll again
144
+
- Otherwise → wait 1 second, then poll again
141
145
142
-
## Result Schema
146
+
## Step 4: Handle retry requests
143
147
144
-
The human's response is returned via `/api/sessions/:id` (poll) or `/api/sessions/:id/wait` (non-Docker blocking):
148
+
When `/wait` returns `status: "rewriting"`, the user clicked "Request Retry". The result contains:
145
149
146
150
```json
147
151
{
148
-
"approved": true,
152
+
"approved": false,
149
153
"revisions": [
150
154
{
151
155
"stepId": "s3",
@@ -160,13 +164,30 @@ The human's response is returned via `/api/sessions/:id` (poll) or `/api/session
160
164
}
161
165
```
162
166
163
-
## Rewrite Cycle
167
+
Agent must:
168
+
1. Read `revisions` — for each, apply corrections to the affected steps
169
+
2. Read `globalNote` — treat as an overarching instruction
170
+
3. Read `resumeFromStep` — re-execute from that step if instructed
171
+
4. PUT the updated trajectory payload back so the page reflects the new steps:
172
+
173
+
```bash
174
+
curl -s -X PUT "$AGENTCLICK_BASE/api/sessions/${SESSION_ID}/payload" \
0 commit comments