Repository navigation
[bug] dsh-superagent: GitHub Source silently drops a mention when its notification arrives late (race with the poll cursor) #11970
Replies: 2 comments
|
I reproduced the comment case with a local Vitest fixture on
In the second run, the Issue cursor advanced to |
|
Independent reproduction on Burst case. Five new Issues, each mentioning the agent in its body, were opened within 6 s ( So a burst that lands in the window before a poll starts is lost as a whole, not one request in three. That is the case Super-agent is built for: several requests at once. Workaround that recovered all five. Wait until From the code, the read-back fix in the original post covers this case. I have not run the patch. |
Uh oh!
There was an error while loading. Please reload this page.
This is about dsh-superagent-prototype, which has Issues turned off, so I am reporting it here.
Summary
When GitHub delivers the agent account's notification later than the start of the next polling round, the GitHub Source reads the notified Issue but treats its body (and comments) as older than the cursor. The request is dropped without a Trigger. It is not counted as filtered, and the Source health stays
ready.With the default 60 s poll and the notification delay we observed (about 23 s), roughly one in three requests can be lost this way.
Observed
A fresh setup, with the agent account mentioned in the body of a new Issue by an allowed login:
created_at) with@<agent> …in the bodygithub-since≈ 05:45:08 (cursorAt(round.started))mentionnotification appears (updated_at), 23 s after the Issueissues/1(github-cursor:1is written), but no Trigger is storedAfter 30 minutes:
GET tickets,GET decisionsandGET threadswere empty, andGET sourcesshowedstats.received: 0,filtered: []. The notification was still unread in the agent account.Cause
In
readNotified(src/sources/github.ts),sinceis the notification cursor:issue.created_at(05:44:57) is earlier than the cursor (05:45:08), because the cursor moved during the notification's delivery delay. The body is skipped as if the Issue were old. The PR description check, and thetimestamp < sincefilter inintakeComments, have the same race for a PR or a comment.Fix
Read back a fixed lag before the cursor in
readNotified, and rely on the existing Trigger ID deduplication (github-issue:<number>,github-comment:<url>:<id>:<updated_at>, andIntakeanswersduplicate):The stored cursors are unchanged; only the comparison and the comments query start earlier. Repository streams and subscribed Thread polling are not affected.
The patch at the end of this post also:
sincequery.Verification
pnpm typecheckpasses.pnpm buildpasses.pnpm test: 1197 of 1198 pass. The one failure exists without this patch:tests/sources.spec.ts > feishu event consumer > … reports a malformed line without stoppingfails consistently on this machine (health endsreadyrather thanerror, likely stderr[event] readyarriving after the malformed stdout line).Environment
mainas of 2026-10-31, version 0.1.0@deepseek-ai/dsh0.2.1-rc.3Smaller note
The first acknowledgement comment did not begin with the GitHub disclosure line from the Communication prompt ("This is by an automated agent, not a human."). The later result comment and the PR description did.
Patch
notification-lag.patch
All reactions