Skip to content

feat(pm-console): ask GitHub by tag, keep to its time, and say why a list is old (#13489) - #13570

Open
dezren39 wants to merge 4 commits into
mainfrom
claude/pm-etags
Open

dezren39 wants to merge 4 commits into
mainfrom
claude/pm-etags

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

What

The half of #13489 that needs no new identity: the edge stops drawing on the hourly GitHub allowance it shares with the agents for lists that have not changed, keeps to the time GitHub gives when it is turned away, and says what happened on the screens it affects.

Twice on 2026-11-23 the agents used the account's hour up, and the edge's reads of pull requests and prompts failed until it turned.

Changes

Asked by tag. Each answer to a read is kept under its address with GitHub's etag and asked for again with if-none-match. GitHub answers "not modified" for a list that has not changed, and such a call does not count against the allowance. GitHub is still asked every time and decides whether the kept answer stands, so nothing shown is older than before. The answers live in the object's memory (bounded, least lately used dropped first).

GitHub's time is kept to. Turned away for calling too often, GitHub says when to ask again (retry-after, or x-ratelimit-reset with nothing left). Until then the edge asks nothing that draws on what ran out, where before it asked again every five minutes. Never for more than 65 minutes; "Try again now" lifts it.

Two allowances, kept apart. GitHub counts searches by the minute and everything else by the hour. Ranked issues are a search, so they are still read while the hour's allowance is spent, and a minute's searches running out does not stop the lists. retry-after is said of the caller and hushes both.

Said in the app. "GitHub's allowance for the hour is used up on this account, which the agents share; GitHub says it answers again at 12:40 PM, and it is not asked before then. Showing the last good copy, read 12 min ago." A short wait, or GitHub's "secondary rate limit", is said as being turned away for asking too often, not as the hour.

A gap found on the way. The screens drawn from the operations document (Pull requests, Ranked issues, Agents, Units) said nothing when their list could not be read: they showed the old copy as if it were current. Each now names its own list.

Health has github: { answers, unchanged, kept, quiet: { core, search } }, so the saving and any wait can be seen from outside.

Not in this PR

  • The edge still has no allowance of its own. When the agents use the hour up, it is turned away with them until the hour turns. That takes an identity of its own on the account, which is the owner's to make; pm-console edge: its own GitHub allowance, so the core does not stop when the fleet is busy #13489 stays open for it.
  • With the allowance used up and no machine, something the owner does is kept for a machine, as before. The edge doing what it holds once GitHub answers again touches the rule against doing anything twice, and is its own change.
  • Whether GitHub answers "not modified" to a tagged read while the allowance is at zero is not known and not relied on.

Checked

  • bun test: 377 pass, 15 files (364 before).
  • The edge tests' stand-in GitHub now tags every read and answers "not modified", so all 111 edge tests run against it.
  • Property tests: when to ask again stays between now and 65 minutes on for any headers; the kept answers match a plain list kept the same way over 18,000 generated steps.
  • Mutation check: 48 faults planted one at a time in the new code; all 48 are caught.
  • Real Worker runtime (wrangler dev and scripts/edge-smoke.ts, which the deploy runs before deploying): a list read again is asked by its tag and the 304 is the kept answer; turned away with a reset time, the Worker asks nothing until that second, then asks again. All checks pass.
  • Real Chrome, light and dark, both ways the app is served: the notices on Pull requests, Ranked issues and Now; axe-core over 22 screens, no violations.
  • biome format, prettier, bun run src/server.ts --check, both wrangler deploy --dry-run builds; the type checker run by hand reports nothing new (53 as before, pm-console: type-check the console before it is deployed #13498).

Not checked: against GitHub itself. The first deploy's health (github.unchanged) will show whether its "not modified" answers arrive as documented.

Design record: doc/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core/ (section "2026-11-23T18:10Z Update").


Generated by Claude Code


Start Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…r asking again

The edge reads pull requests, ranked issues and prompts from GitHub with
the fleet's token, so it draws on the same hourly allowance the agents
do. Twice on 2026-11-23 the agents used the hour up and the edge's
reads failed until it turned (#13489).

- Each answer to a read is kept under its address with GitHub's tag,
  and asked for again by that tag. GitHub answers "not modified" for a
  list that has not changed, and such a call does not count against
  the allowance. A screen left open asks for the same lists every
  minute or two: those calls now cost nothing unless something changed.
- Turned away for calling too often, GitHub says when to ask again
  (retry-after, or the turn of the hour when nothing is left). That
  time is now kept to: nothing is asked of GitHub until it has come,
  where before the edge asked again every five minutes. It is never
  kept to for more than a little over an hour, and the owner's "try
  again now" lifts it.
- Why a read failed now starts with that time, so the app can say when.
- Health says how many of GitHub's answers were "not modified", so the
  saving can be seen from outside.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
… screen why its list is old

Follows the commit before it on this branch (#13489).

- GitHub counts searches by the minute and everything else by the
  hour. The time it gives for asking again is now kept to for what
  draws on the allowance that ran out, not for everything: ranked
  issues (a search) are still read while the hour's allowance is
  spent, and a minute's searches running out does not stop the lists.
  Going too fast (retry-after) is said of the caller and hushes both.
- A call held back is marked as not sent, and why it failed carries
  GitHub's own words, so the app can say which of the two it was.
- The app: "GitHub says it answers again at 12:40 PM, and it is not
  asked before then", and how old the copy shown is.
- The screens drawn from the operations document (pull requests,
  ranked issues, agents, units) said nothing when their list could not
  be read: they showed the old copy as if it were current. Each now
  names its own list and is told of that one.
- The real-runtime smoke run has GitHub's stand-in tag its answers and
  turn calls away with a time, and checks both in the Worker runtime.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 24 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 58e03f6c-68a9-44c5-8ab8-85c46d49c4c1
Commits

Reviewing files that changed from the base of the PR and between a5ed02d and 06914ce.

Files selected for processing: 11

  • doc/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core.md
  • planning/roadmaps/pm-stack.md
  • pm-stack/console/edge/README.md
  • pm-stack/console/edge/src/direct.ts
  • pm-stack/console/edge/src/edge.ts
  • pm-stack/console/public/app.js
  • pm-stack/console/scripts/edge-smoke.ts
  • pm-stack/console/src/ops.ts
  • pm-stack/console/test/app.test.ts
  • pm-stack/console/test/direct.test.ts
  • pm-stack/console/test/edge.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 06914ce89d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if (only && !only.includes(name)) continue;
if (s.ok || !s.error) continue;
const what = name === "services" ? "the machine's units" : SECTION_SAID[name] || name;
const read = doc.read?.[name] ? `, read ${ago(doc.read[name], now)}` : "";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the last successful read time for the stale-copy age

When a refresh fails, this reports the age of the failed attempt rather than the last good copy. Docs.refresh() updates the section's at even on failure while preserving goodAt, and Docs.doc() populates doc.read from at. Consequently, an hours-old list can be described as “read just now,” with its displayed age resetting on subsequent failed refreshes. Expose and use the last-successful-read timestamp for this notice so users can assess how stale the displayed data actually is.

Useful? React with 👍 / 👎.

}
if (!write && memory) {
const etag = res.headers?.get("etag") ?? null;
if (etag) memory.set(url, { etag, text });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid caching an unreadable response body

If a successful GET supplies an ETag but res.json() rejects—for example, when the connection closes while reading the body—the catch above converts the failure into empty text, which is then cached under the valid ETag. Subsequent requests receive 304 responses and reuse that empty text until the resource changes, the entry is evicted, or the object restarts. Ops.gh() converts empty stdout to null, so consumers such as Ops.prs() repeatedly fail at list.map instead of recovering on the next refresh as they did before. Only cache the response's ETag after its body has been successfully consumed and decoded.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T18:11:10.242955Z 06914ce PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
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