Repository navigation
fix(agent): stop polling expired webhook traces - #20619
Conversation
Signed-off-by: T1mn <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthrough
ChangesWebhook Trace Polling
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The missing-trace behavior has targeted test coverage, and no actionable issue remains before merge. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit polls the quiet trace, Comment |
Summary
Follow-up to #18815 and #19087 in the Go webhook trace path. This is independent of the request-reading fix in #20618.
After a client has selected a
webhook_id, the trace key can expire while polling is paused. The empty-store branch currently returnswebhook_id=nullandfinished=false, so the client keeps polling. A missing run in a non-empty store already ends polling.Treat a missing store the same way as a missing selected run: preserve the ID and cursor, return an empty event list, and set
finished=true. Polling without a selected run still waits for a trigger. No execution-success event is synthesized; the existing UI requires an explicit successful terminal event to show success.Adds table-driven polling tests and a handler test that expires the key after discovery and checks repeated polls.
Validation
agent_webhook_trace.goandagent_webhook_trace_poll_test.gopass with-raceon Go 1.26.6: seven cases. The two missing/blank selected-trace cases fail before the fix.gofmtandgit diff --checkpass.bash build.sh --test ./internal/handler/... -run 'TestPollWebhookTrace|TestGetAgentWebhookLogs' -count=1stops because the native DeepDoc backend does not support macOS. Linux CI is still needed.Thank you for reviewing.