Skip to content

Tell agents to react to events instead of polling - #15029

Merged
dhh merged 1 commit into
quattrofrom
agent-notes-no-polling
Oct 11, 2026
Merged

dhh merged 1 commit into
quattrofrom
agent-notes-no-polling

Conversation

@dhh

@dhh dhh commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

A performance pass found several places where long-running code polls state that changes only through known events: the passwordless sudo indicator (5s), the power profile (2s), the workspace layout on every switch, and the Thunderbolt authorization daemon (~5% of a core on machines with a controller).

This adds a "Keeping state current without polling" section to agents/skills/shell-dev.md with the order to reach for: native Quickshell services, existing event streams, file watches, then having the command that changes the state ask for a refresh (with a systemd-run --user timer for later changes like expiry). Polling is a last resort, never per monitor and never for a privileged check. AGENTS.md gets a short "Background Work" rule pointing at it, so it also applies to bash daemons.

The section uses omarchy-sudo-passwordless as an example of the push-refresh pattern, which lands in the sudo indicator PR.

🤖 Generated with Claude Code

@dhh

dhh commented Oct 11, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@greptile-apps

greptile-apps Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable issue was found.

Summary

Adds event-first guidance for long-running shell code and daemons.

  • Background work updates state from events before turning to polling.

Reviews (1) · Last reviewed commit: "Tell agents to react to events instead o..." · Reviewed by Greptile

@dhh
dhh merged commit 8bd1b7c into quattro Oct 11, 2026
1 check passed
@dhh
dhh deleted the agent-notes-no-polling branch October 11, 2026 13:42
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants