Repository navigation
Description
Problem
A repository with no open work polls at the same rate as a busy repository. Evidence from #3497, in the window 2026-11-03T15:05Z to 2026-11-04T15:05Z:
- An idle repository costs 1178 to 1373 requests a day. For one such repository, the rows
metricsandotherare 753 of 1373. - The budget is shared across repositories. The spend was at or above 1990 of 2000 for 246 of 1440 minutes (17%).
The code at origin/main f6d57ec:
service.poll_interval_secondsis one value for all repositories (src/devops_cli/config/settings.py:1097).RequestBudget.poll_intervalmakes the interval longer only when the rounds of a poll cost more than the budget pays for (src/devops_cli/server/service.py:278). It does not look at the open work of a repository.
Expected
A setting gives a longer poll interval for a repository with no open work. A webhook delivery still starts its update at once (ADR 0017), and the first new item ends the idle state.
The refine plan on #3497 proposes roadmap.poll_interval_idle_seconds with a default of 600 seconds. The plan of this item confirms the name and section against src/devops_cli/config/settings.py, because the current interval is in the service section, and it defines "no open work".
Acceptance criteria
- A setting gives a longer poll interval for a repository with no open work, and a test reads it.
Existing tool considered
ADR 0003 keeps the poll, and ADR 0017 keeps the webhooks. The change adds one setting to the existing loop, and no library.
Related
Split from #3497, which holds the evidence. It holds criterion 8 of that issue.
Source: #3497
Proposed design
Problem statement
The Service polls an idle repository at the same rate as a busy repository. The shared request budget pays for that work. This change adds an idle poll interval, and a webhook still starts an update at once.
Acceptance criteria
Requirement: Idle interval setting
The configuration SHALL define service.poll_interval_idle_seconds in the service section with a default of 600 seconds.
Scenario: Default idle interval
- WHEN The configuration loads with no value for
service.poll_interval_idle_seconds. - THEN The loaded value is 600 seconds.
Requirement: Idle interval validation
The configuration MUST reject an idle interval that is shorter than service.poll_interval_seconds.
Scenario: Short idle interval
- WHEN The configuration sets
service.poll_interval_idle_secondsto 30 andservice.poll_interval_secondsto 60. - THEN Loading the configuration fails with a validation error that names both settings.
Requirement: Idle repository interval
The Service SHALL use service.poll_interval_idle_seconds for a repository with no open issues and no open pull requests.
Scenario: Repository with no open work
- WHEN The repository has zero open issues and zero open pull requests, and the idle interval is 600 seconds.
- THEN The next poll for the repository is scheduled after 600 seconds.
Requirement: Busy repository interval
The Service SHALL use service.poll_interval_seconds for a repository with at least one open issue or open pull request.
Scenario: Repository with open work
- WHEN The repository has one open issue or one open pull request, and the normal interval is 60 seconds.
- THEN The next poll for the repository is scheduled after 60 seconds.
Requirement: Webhook ends idle state
A webhook delivery for an issue or pull request event MUST start the update at once and MUST clear the idle state.
Scenario: New issue webhook on idle repository
- WHEN A repository is idle and a webhook delivery reports a new open issue.
- THEN The Service starts the update at once and schedules the next poll with the normal interval.
Requirement: Poll ends idle state
A poll that finds open work MUST clear the idle state and schedule the next poll with the normal interval.
Scenario: New issue found on idle poll
- WHEN An idle repository poll returns one open issue.
- THEN The Service clears the idle state and schedules the next poll with the normal interval.
Requirement: No extra request for idle check
The Service MUST derive the idle state from the issue and pull request data that the poll already fetches.
Scenario: Poll of idle repository
- WHEN The Service polls a repository with no open work.
- THEN The poll makes no additional GitHub request to decide that the repository is idle.
Existing Tool Considered
No alternatives check has run. This change uses no separate tool or library. It adds one setting and one interval branch to the existing poll loop. The build cost is about 2,000 tokens and under one hour.
Key questions
- Which configuration key and section hold the idle poll interval?: Use
service.poll_interval_idle_secondsin theservicesection. Set its default to 600 seconds. The current interval isservice.poll_interval_seconds, so the idle interval belongs in the same section. (best practice) [sources: src/devops_cli/config/settings.py:1097, src/devops_cli/server/service.py:278]- Chosen:
service.poll_interval_idle_seconds. It matches the section ofservice.poll_interval_secondsand keeps one prefix for the poll loop. - Rejected:
roadmap.poll_interval_idle_seconds. The current poll interval is in theservicesection, so this key splits one loop across two sections. - Rejected:
service.idle_poll_interval_seconds. It puts the qualifier before the noun and does not match the existingpoll_interval_secondsname.
- Chosen:
- What does "no open work" mean for a repository?: A repository has no open work when it has zero open issues and zero open pull requests. A candidate issue is open work because intake must process it. (best practice) [sources: CONTEXT.md, docs/adr/0003-polling-is-how-the-roadmap-sees-changes.md]
- Chosen: No open issues and no open pull requests. It includes candidate issues that intake must process and pull requests that the Service must track.
- Rejected: No open item with a priority label. It ignores candidate issues without a priority label, so intake could wait for the idle interval.
- Rejected: No open issue, no open pull request and no open event. It needs extra state and does not match the data that the poll already fetches.
- Where does the Service hold the idle state?: Hold the idle state in the existing per-repository
RequestBudget. That class already chooses the poll interval. (best practice) [sources: src/devops_cli/server/service.py:278]- Chosen: Extend
RequestBudgetwith an idle flag. The class already selects the interval, so the change stays in one place. - Rejected: Add a separate idle-state map. It duplicates per-repository state and adds a second place to update.
- Rejected: Query GitHub on every poll. It adds a request and works against the goal to reduce requests.
- Chosen: Extend
- How does the Service detect open work without an extra request?: Derive the counts from the issue and pull request data that the poll already fetches. Cache the result for each repository. (best practice) [sources: src/devops_cli/server/service.py:278, docs/adr/0003-polling-is-how-the-roadmap-sees-changes.md]
- Chosen: Use the poll response. It adds no GitHub request and uses data that the Service already needs.
- Rejected: Use the GitHub search API. It adds a request and consumes the shared budget.
- Rejected: Use only webhooks. ADR 0003 keeps polling as the source of truth, so a missed webhook would leave the state wrong.
- How does a webhook interact with the idle interval?: A webhook delivery for an issue or pull request event starts the update at once. It clears the idle flag. The next poll uses the normal interval. (best practice) [sources: docs/adr/0017-each-subscribed-webhook-event-runs-the-update-scoped-to-it.md, docs/adr/0003-polling-is-how-the-roadmap-sees-changes.md]
- Chosen: Clear idle on webhook. ADR 0017 runs the update at once, so the repository is active again.
- Rejected: Keep idle until the next poll. It would delay the first update after the webhook and ignore ADR 0017.
- Rejected: Disable polling for idle repositories. ADR 0003 keeps polling as the source of truth when a webhook is missed.
- Should the idle interval be validated against the normal interval?: Yes. The idle interval MUST be at least
service.poll_interval_seconds. (best practice) [sources: src/devops_cli/config/settings.py:1097]- Chosen: Validate idle >= normal. It prevents a setting that makes an idle repository poll more often than a busy one.
- Rejected: Accept any positive value. A shorter idle interval contradicts the purpose of the setting.
- Rejected: Clamp silently. It hides a configuration error from the operator.
- Which service path uses the idle interval?: The repository poll loop uses the idle interval for every lane trigger. A webhook delivery bypasses the interval and runs at once. (best practice) [sources: docs/adr/0003-polling-is-how-the-roadmap-sees-changes.md, src/devops_cli/server/service.py:278]
- Chosen: Apply to every lane trigger. The lanes share the repository poll, so one idle interval reduces the shared request budget.
- Rejected: Apply only to the status lane. The model lane also polls and would keep the idle cost high.
- Rejected: Apply only to the metrics row. It does not reduce the other idle requests enough to meet the goal.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-08: none.
Tool: none found.
Activity
dan-petty commentedon Nov 5, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(service)scope of the title gives the scope.It cuts API spend for idle repositories but does not fix a broken feature or a security gap.Idle repositories stop consuming a share of the shared GitHub budget, freeing it for active work.The body states the change adds one setting to the existing poll loop and one condition check.Both reduce the cost of polling a repository with no new activity, but 1401 skips the request when no event changed, while the candidate lengthens the interval when no open work exists.fix(service): count each GitHub request with its HTTP status (#3686)
devops-cli-service commentedon Nov 7, 2026
Status set to Ready at 876f424 (see proposed design in issue body).
devops-cli-service commentedon Nov 8, 2026
Alternatives check: none
Reason: The searches returned only unrelated pages (MDN documentation on the browser Idle Detection API and GitHub/MDN community pages); no open, maintained tool or library provides a configurable "poll interval for a repository with no open work" setting for a project's own service loop. The issue itself asks for one new setting plus an interval branch inside the existing poll loop (kept by ADR 0003, webhooks by ADR 0017, scheduling by ADR 0008), which is a code change and no external dependency.
Tool: none found
Lacks:
service.poll_interval_idle_secondssetting with validation against the normal intervalSearches run:
Sources:
Checked on 2026-11-08. A person decides what this means for the item. The check changes no label and closes no issue.
test(security): declare the idle poll interval variable (#3672)
devops-cli-service commentedon Nov 14, 2026
Released in v0.139.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.139.0
devops-cli-service commentedon Nov 14, 2026
Live since 2026-11-14 17:02 UTC