# fix\(server\): idle servers no longer sweep branch pull requests every minute \(\#23702\) · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/29ce300674cd6e5ea2b183c8bde4e3ad10a2a4cd)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: 29ce300674cd6e5ea2b183c8bde4e3ad10a2a4cd

Requested commit: 29ce300674cd6e5ea2b183c8bde4e3ad10a2a4cd

Commit: 29ce300674cd6e5ea2b183c8bde4e3ad10a2a4cd

Tree: baeffb4bb80e6b8302ffcc1bc49ce14af07212a5

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
fix(server): idle servers no longer sweep branch pull requests every minute (#23702)

The one-minute sweep looked up every active branch thread's pull request even
with no client connected. It now runs only when BackgroundPolicy reports
foreground demand (shouldRunOpportunisticWork) and resumes on the next tick
once a client is back. The startup backfill and thread events (finished turns,
unsettle, metadata changes) still refresh unconditionally, so headless agents
and scheduled tasks keep their pull request links current.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

```

## Parents

- [1e1b2b9ea9e66f3a7394ed328c6dd2da00d00029](https://git.cafe/pingdotgg/t3code/commit/1e1b2b9ea9e66f3a7394ed328c6dd2da00d00029?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/29ce300674cd6e5ea2b183c8bde4e3ad10a2a4cd?format=markdown)
