Skip to content

Commit 9b3e3cb

Browse files
committed
fix(skill/memory): add Docker env detection for session polling
1 parent cd40165 commit 9b3e3cb

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

skills/clickui-memory/SKILL.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ Use this for file browsing (not approval completion):
7070
- Open a file: `GET /api/memory/file?path=<absolute-path>`
7171
- UI route: `/memory-management`
7272

73-
## Wait Protocol
73+
## Poll Protocol
7474

75-
After creating a `memory_review` session, block on:
75+
After creating a `memory_review` session, poll for the decision:
7676

7777
```bash
7878
if curl -s --max-time 1 http://localhost:38173/api/health > /dev/null 2>&1; then
@@ -81,7 +81,17 @@ else
8181
AGENTCLICK_BASE="http://host.docker.internal:38173"
8282
fi
8383

84-
curl -s "$AGENTCLICK_BASE/api/sessions/${SESSION_ID}/wait"
84+
# Detect environment: GOG_ACCOUNT is set in Docker (docker-compose.yml), absent elsewhere
85+
if [ -n "$GOG_ACCOUNT" ]; then
86+
# Docker: use short-poll (one curl per exec, you are the loop controller)
87+
curl -s "$AGENTCLICK_BASE/api/sessions/${SESSION_ID}"
88+
else
89+
# Non-Docker: use blocking /wait
90+
curl -s --max-time 310 "$AGENTCLICK_BASE/api/sessions/${SESSION_ID}/wait"
91+
fi
8592
```
8693

87-
If status is `rewriting`, update payload via `PUT /api/sessions/:id/payload` and wait again.
94+
- 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.
95+
- In non-Docker: the `/wait` call blocks until state changes, then process the result.
96+
97+
If status is `rewriting`, update payload via `PUT /api/sessions/:id/payload` and poll again.

0 commit comments

Comments
 (0)