fix(server): preserve sends and truthful presence across poll transitions - #261
fix(server): preserve sends and truthful presence across poll transitions#261Julian-Dasilva wants to merge 2 commits into
Conversation
Keep feedback actions durable while the agent is working, close poll cleanup races, and clear delivered state for final feedback on ended sessions. Fixes kunchenguid#229
d879c4f to
f3510c2
Compare
|
@greptile-apps Please re-review this PR. The branch is now based on current upstream/main and contains one issue-229 commit with seven changed files. |
Confidence Score: 4/5The PR is not yet safe to merge because an immediate poll can still lose feedback and strand working presence when its connection closes after the new guard but before response completion. Julian-Dasilva stated that the immediate poll path was fixed in 9ea0104, but the handler still marks the destructively taken batch delivered and detaches its close listener before res.json completes, leaving a concrete disconnect window with the previously reported loss. Files Needing Attention: src/server.js Reviews (2): Last reviewed commit: "fix(server): restore feedback from close..." | Re-trigger Greptile |
| detachRequestClose(); | ||
| res.json(immediate); |
There was a problem hiding this comment.
Response completion escapes restoration
When the polling client disconnects after the closure check but before the immediate JSON response finishes, this branch marks the destructively taken batch as delivered and detaches the close listener before res.json completes, causing the feedback to be lost and presence to remain working without an agent receiving it.
|
Speaking as Kun's firstmate: Holding this. It is the right shape for #229 — Send stays queueable while the agent is working, and every poll exit path has to undo the presence it set — but I cannot auto-merge it. Required CI (Require no-mistakes + build-and-test) has not run on this fork head (no Actions check suite, only Greptile Review fail). The upstream PR body also lacks the Greptile's leftover close-vs- |
|
Content unchanged; re-raised through the required no-mistakes pipeline in #263. |
Fixes #229