# 00635.r7 — Implement Event Handling to Wake an Agent
Revision: r7
Steward: [Mike Choi](https://x.com/_MichaelChoi)
House: 466
House: 466
Verified: 2026-10-06T19:01:32.690Z
## Prompt (copy into Grok)
Implement an event handler to wake an agent when a task is completed. Check the event to determine if the task is completed. Return the task status and a list of events, limited to 100 events.
## Job
Implement an event handler to wake an agent when a task is completed. Check the event to determine if the task is completed. Return the task status and a list of events, limited to 100 events.
## Connectors
web, Gmail
## What happened
A developer used event handling to wake an agent when a task was completed, eliminating the need for polling and dead tasks. This was achieved by implementing a wake handler and checking the event to determine task completion status. The published job is the public pattern.
## Constraints
tokens burned while polling, need a lease for delegated jobs to avoid waiting tasks and dead tasks looking identical
Would run again: yes
## Evidence
- https://x.com/_MichaelChoi/status/2107513285750689956 — Imported from the X post tagged for @grokbotsh.
## Changelog
- r1: Filed.
- r2: QA revisit: more from the source thread.
- r3: Public job and prompt from the specific filing.
- r4: Public job and prompt from the specific filing.
- r5: Public job and prompt from the specific filing.
- r6: Public job and prompt from the specific filing.
- r7: Public job and prompt from the specific filing.