Skip to content

fix(pm-console): keep GitHub's answers in the object's storage; its memory did not last between reads - #14000

Merged
dezren39 merged 5 commits into
mainfrom
claude/pm-kept
Nov 24, 2026
Merged

dezren39 merged 5 commits into
mainfrom
claude/pm-kept

Conversation

@dezren39

@dezren39 dezren39 commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

What was wrong

#13570 kept GitHub's answers (to ask for again by their tags), the times GitHub said to ask again, and the count of its answers in the Worker object's memory. Cloudflare takes an idle Durable Object out of memory after about ten seconds and starts another, with nothing in memory, on the next request (lifecycle). This object reads a list every minute or so. So in service every read was made by an object that had kept nothing: every read was a full one, and nothing was saved.

What was said when #13570 merged, that a list that has not changed no longer uses any of the hourly allowance, was true of the tests and not of the deployed Worker.

Found by reading the live Worker two hours after the deploy (2026-11-24 00:45Z): health showed github: {answers: 0, unchanged: 0, kept: 0} seven minutes after a self-check that had made four reads, with no deploy in between.

Why nothing caught it: every unit test, every planted fault and the real-runtime check read a list twice within one object's life. The edge's tests could start a new object over the same storage all along; none of the memory's tests did.

What this changes

  • Kept in the object's storage (edge/src/direct.ts, githubMemory). An answer is stored in pieces of 600,000 characters: a stored value holds about two million bytes, and the real list of sixty open pull requests was 1.4 million characters of two bytes each when measured today. Each piece is marked with the address and tag it belongs to; one index names the pieces and is written last. An answer half stored when the object was put away, or when the store failed, reads as nothing kept, never as an answer.
  • Bounded. 240 answers and thirty million characters at most; the one longest unasked-for goes first, never the one just kept. Places are few and used again, and whoever writes to a place or empties it clears whatever else is in it.
  • One change at a time. An object's first look reads every list side by side: two new answers kept at once would have taken the same place.
  • GitHub's wait and the count, the same way. An object that starts during a wait keeps to it; "Try again now" is stored too. Health's github.answers and github.unchanged are counted since github.since, whichever object answered.
  • A store in trouble. One that cannot be written is a memory that forgot. One that cannot be read is not written to (what it holds is not to be written over with less), is tried again by the next to ask, and the object keeps to GitHub's wait in its own mind meanwhile. What is read back is held to what could have been written: a wait for no longer than one can be set for, an index line for no more than an answer kept here can be.
  • Health says when the object started (woke), so how long one lasts can be seen from outside.
  • Nothing left running (src/timed.ts). AbortSignal.timeout leaves its timer running for the whole deadline after the request is over, and an object with a timer running is not put away. Measured in the local runtime: an object that had asked GitHub one thing (twenty seconds allowed) was still in memory 26 s after its last request and gone by 32; one that had left no timer was there at 11 s and gone within 14. Deadlines for GitHub, the push services, the key set, the released build and the dashboard now clear their timer when the request is over, and an answer whose body will not be read is let go of at once (the old deadline did that only when it ran out). A test follows the Worker's imports and fails if anything it runs uses AbortSignal.timeout.
  • The real-runtime check puts the object away (scripts/edge-smoke.ts): it leaves the Worker alone until health says another object answers, then asks the first one's questions of it.
  • A test that main is failing on (test/plan.test.ts). It asked that the id roadmap have at least ten rows; the planners tidied it to eight at 00:34Z (docs(roadmap): program-tending drift fix (landed forward items) #12663), and every run of the console's tests has failed since, which would stop the next deploy. It now asks that the roadmap files have rows between them and leaves how many each has to the planners.

Checked

  • bun test: 403 pass. Type check, formatter and the markdown check clean. Both builds (node build.mjs, the bundle the deploy uses) succeed.
  • The fault itself, as a test: the edge's new test starts a new object between two reads of a list. With the memory given no store, as first built, it fails.
  • A property over generated runs of keeping, asking, letting go, starting again and being stopped part-way at any write, with pieces as small as one character: what is read back is an answer that was kept or nothing; each place holds its first so many pieces with none missing; the places are few; no more is kept than there is room for; a change that finishes leaves nothing behind it. It found one fault in its own model on the way (an earlier half-kept answer can still be the one read after a later one got nowhere).
  • Planted faults: 73 single faults in the memory, the deadline and the edge's use of them; 71 fail a test. The two that pass each remove a check that another doubles (a missing index line, also caught by the catch around the read; a missing piece, also caught by the answer's length): the read gives the same "nothing kept" either way.
  • In the real runtime (wrangler dev): all 41 checks pass. Left alone for 15 s the object was put away; the next one still asked for a long answer (over 1.2 million characters of two units each, one cut in half by a piece's edge) by its tag, and GitHub's stand-in still answered "not modified"; a wait GitHub had set was still kept to; "Try again now" lifted it; the count went on from the one before. With the memory in the object's own memory, as first built, the same run fails two checks (the wait is forgotten: "4 calls while quiet").
  • Measured in the edge's tests, one hour of the object's own clock with nothing changing: 60 reads of GitHub, all "not modified"; 74 writes to storage, 60 of them the count.

Not checked

  • The deployed Worker. That GitHub itself now answers it "not modified" is to be read from live health after this deploys: github.kept above nought and github.unchanged growing while woke changes. I will read it and say what it shows on pm-console edge: its own GitHub allowance, so the core does not stop when the fleet is busy #13489.
  • How long an object lasts in service. The 11 to 14 seconds is the local runtime's.
  • The changed deadlines for the key set, the released build and the dashboard have no test of the deadline itself (none had before); their tests pass through the new helper. The push services' has one now.

Not in this

The same wrong assumption sits in a few other places in the object (the ten-minute gate on asking for the released Android build is in memory; the queue store is asked with no deadline). #14001 has the list, to be gone through one by one.

Refs #13489, #13504. Design record: the 2026-11-24T01:45Z correction in doc/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core/.

https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF


Generated by Claude Code

The plan pages' test asked that the id roadmap have at least ten rows.
The planners tidied it to eight (#12663, merged 2026-11-24 00:34Z), and
every run of the console's tests has failed since: the next change to
the console would have been stopped at the deploy's first step.

What the count was for is a parser that reads nothing passing the loop
above it. It now asks that the roadmap files have rows between them.

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

#13570 kept GitHub's answers (asked for again by their tags), the times
it said to ask again and the count of its answers in the Worker
object's memory. Cloudflare takes an idle Durable Object out of memory
after about ten seconds and starts another on the next request, and
this object reads a list every minute or so: in service every read was
made by an object that had kept nothing, every read was a full one, and
nothing was saved. Seen on the live Worker on 2026-11-24 at 00:45Z:
health said answers 0, unchanged 0, kept 0, seven minutes after a
self-check that had made four reads.

Nothing caught it because every test, every planted fault and the
real-runtime check read a list twice within one object's life.

- The memory is kept in the object's storage. An answer is stored in
  pieces of 600,000 characters, each marked with the address and tag
  it belongs to, under one index written last: an answer half stored
  when the object was put away reads as nothing kept. 240 answers and
  thirty million characters at most, the one longest unasked-for going
  first. Places are few and used again, and whoever writes to one
  clears whatever else is in it. One change is made at a time.
- GitHub's wait and the count are stored the same way. Health counts
  since `github.since` whichever object answered, and says when the
  object answering started (`woke`).
- A store that cannot be read is not written over, and is tried again.
- Deadlines on outgoing requests are made with `timed`, which clears
  its timer when the request is over. `AbortSignal.timeout` leaves its
  timer running for the whole deadline, and an object with a timer
  running is not put away: in the local runtime, 26 seconds in memory
  after one call of GitHub against under 14 with no timer left. A body
  that will not be read is let go of at once.
- The real-runtime check leaves the Worker alone until health says
  another object answers, and asks its questions of that one. With the
  memory in the object's mind, as first built, it fails.

The design record has the correction in full.

Refs #13489, #13504

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

Two issues filed on 2026-11-23 had no row: #13831 (the edge does what
it holds for a machine itself, once it can) and #13833 (the laptop's
console follows main).

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

coderabbitai Bot commented Nov 24, 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 18 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: 92d99fba-68f5-42c2-b545-ecfa74c87a73
Commits

Reviewing files that changed from the base of the PR and between 98db2cc and 7959051.

Files selected for processing: 15

  • 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/scripts/edge-smoke.ts
  • pm-stack/console/src/auth.ts
  • pm-stack/console/src/push.ts
  • pm-stack/console/src/timed.ts
  • pm-stack/console/src/work.ts
  • pm-stack/console/test/direct.test.ts
  • pm-stack/console/test/edge.test.ts
  • pm-stack/console/test/plan.test.ts
  • pm-stack/console/test/push.test.ts
  • pm-stack/console/test/timed.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

…ve been written

A wait read back is kept to for no longer than one can be set for
(sixty-five minutes): a time further off in storage would otherwise
keep the edge from asking GitHub until the owner said to try again.
An index line that says more pieces than an answer kept here can have,
or a length no answer has, is not taken: what is read back says how
many pieces to clear and how much is held.

The record names #14001 for what else the object keeps only in memory.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
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