Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -973,3 +973,192 @@ One small thing seen with it: the check's time moved from 03:42:46 to
03:42:49 between two reads of health. Two health reads arrived while
the hourly check was due, and each ran it. At most a few reads of
GitHub once an hour, and nothing shown wrongly; noted and left.

## 2026-11-24T04:30Z Update: what is held, done here when the edge can (#13831)

**What it was.** Something the owner did while the edge was turned
away and no machine could be reached was held for a machine, and only
a machine ever did it. Since the edge keeps to GitHub's own time for
asking again, that could be most of an hour of waiting for a laptop
that was not coming, for a comment or a rank the edge could have made
itself a few minutes later.

**What it does now.** When it can act again (the time GitHub gave has
come, the hour it leaves a kind alone is up, or the owner says to try
again) the edge wakes itself and does what it holds of the kinds it
runs: the oldest first, each thing's actions in the order they were
done, and nothing about a thing behind one it could not do. The wake
is the object's own alarm, asked for whenever something is kept; there
is no other place the held list is worked through.

**Never twice.** An action is one side's or the other's, never both.
(As first written here this was wrong in one case, found before it was
merged: see the correction below.)

- _A machine's_ once a report's answer has handed it out: the machine
may be doing it. The edge never takes it, nor anything else about
the same thing while it waits.
- _The edge's_ once it is out of the held list, which happens, and is
written down (`taken`), before anything is begun. A machine that
reports meanwhile is not handed it, nor what waits behind it about
the same thing (that would be done out of turn).
- _Turned away again_ before anything was written, it goes back where
it was, a machine's by name as before.
- _Put away part-way_, it is settled by the next object from its
record: ended; never begun, and it waits again; or begun and not
known to have ended, which neither side does again, and the owner is
told to look.

**Four faults in what was there, found doing this.** The edge already
did an older held action itself in one case, when a newer one about
the same thing arrived (#13398, a fleet lane's #13652).

- It began the older one while it was still in the held list. A
machine reporting before it ended was handed it too, and would have
done it a second time.
- Turned away while trying it, the record that made the name a
machine's was cleared and not put back: sent again under that name
later, it could have been done here and by a machine.
- A held rank was dropped as "replaced" by any newer action about the
same issue, a comment included. Only a newer rank replaces a rank.
- An older held action that only a machine can do (marking a need
done) was tried here when a comment on the same need arrived, failed
for want of the means, and was lost. The newer one now waits behind
it.

**Also.** The day's limit on what is held was only kept when a machine
reported; it is kept on the edge's own wake now. A pass that could do
nothing is not tried again for a minute, so that a fault cannot have
the object waking every second.

**Checked.** Fifteen tests at the edge, each starting from the owner's
action being held: done here once with no machine; at GitHub's time
and not before; in order; a handed one left alone, with what waits
behind it; a machine reporting half-way through; a newer one arriving
half-way through; turned away again; put away part-way (each of the
three records); the last rank winning, and a comment not replacing
one; what only a machine can do left for it; a side that no longer
does the core doing none of it; the day's limit with no machine; a
wake asked for with nothing else to wake it; and the pause after a
pass that did nothing. 41 single faults planted in the new code: 40
fail a test. The one that does not takes a failure of storage in the
middle of an action for being turned away; the store the tests have
cannot fail in the middle of one and work again for the next write,
so the two cannot be told apart there. In the real runtime: with the
host out of reach and GitHub's stand-in turning the Worker away, a
comment is held and nothing written; when it answers and the owner
says to try again, the Worker's own alarm fires and the comment is
made once.

**Not done.** An action handed to a machine that then never reports
stays the machine's until the day is up: the edge cannot know whether
it was done. Every kind is kept to GitHub's time, though moving a task
asks only the queue store.

## 2026-11-24T05:00Z Correction: an action sent to the host may have been done there (#13831)

**The fault, mine, found reading the change before merging it.** The
rule above took "never handed out in a report's answer" to mean "never
reached a machine". It does not. Nearly everything held gets there by
being sent to the host and getting no answer, and no answer has two
meanings: the host never had the request, or the host did it and the
answer was lost on the way back. The second kind was done again by the
edge once it could. A test written first showed it: a comment the
laptop made, its answer lost, the laptop then away; an hour later the
edge made the same comment a second time. The code this was built on
(#13652) had the same hole in its one case, and waking by itself made
it reachable with nobody doing anything.

**What can be known.** What comes back from asking the host is one of
three things: the host's own answer; nothing (the time ran out, the
connection broke); or an answer from what stands in front of it. Only
Cloudflare's 530 says the host never had the request. Cloudflare gives
it (with error 1033 in the body) when the tunnel has no connection to
send anything down, which is what a laptop asleep or off looks like.
Its documentation says so of both: the 530 page, and the 1033 page
("cannot find a healthy `cloudflared` instance to receive the
traffic"). A 502 from the tunnel's own daemon does not say as much (it
is also what a connection lost part-way looks like), and is treated as
no word.

**The rule now.** A held action is the edge's to do only when it is
known to have reached no machine: it never set off toward one, or it
set off once and that one asking was answered 530. It then carries the
word `unsent`. Without the word it is a machine's by name, as
everything held was before this change: handed to the host when it
reports, which says what became of it. The word is the positive one on
purpose. What is held in service today was kept by a version that did
not write down how the asking ended, and has no word either way; read
as "may have", it is left to the laptop.

**The same name, asked twice.** A device gives up on a send after a
minute and offers the name again, while the edge gives the host a
little longer. So two askings under one name can be out at once, and
word that the second never arrived says nothing of the first. Every
setting-off is counted under the name, and a 530 is believed only for
a name that set off once. Three more cases follow from the same
thought:

- One waiting here that reached nobody is not sent toward the host
when its device offers it again. It would be on its way there while
the edge may be taking it for its own.
- A name the edge has taken to do itself, offered again in that
moment, is not sent to the host as well. The device is answered with
what came of doing it here, or told that it is not over.
- A name whose first asking is still out, offered again while
something else about the same thing waits here, is kept as the
host's.

Also: a newer action about a thing waits behind an older one the host
may have, where before it waited only behind one handed out (a newer
rank would otherwise have replaced an older rank the host may be about
to set, and the older would have been the last word). And a host's
answer that cannot be read settles the name as any answer of the
host's does; it used to leave a hold under it.

**What the owner sees.** Each held action is one of three, and is said
as that when it is kept, in "What you did", on the Machines screen and
in the note the device keeps: either side's, whichever can first; a
machine's only; or one a machine was given or may have got, which
nobody else does meanwhile. Dropped after a day, the last kind is said
to be worth checking, not "not sent". The health answer counts the
three (`held`), so that what the Worker made of a laptop being away
can be seen from outside.

**Checked.** Thirteen more tests at the edge (28 now for this change),
the first of them written before the fix and seen to fail: the answer
lost; out of reach each way, side by side; offered again while
waiting; offered again with the first asking still out; the same with
something else waiting; a newer one behind one the host may have, a
rank among them; offered again at the moment the edge has taken it,
done and turned away; one kept by the version before; a name from
before the counting; an unreadable answer; and a take that could not
be written down leaving nothing marked as being done. In the real
runtime the Worker's own reading of what comes back is exercised both
ways: the host's stand-in answering 530, the comment is held as either
side's and the Worker makes it once; answering 502, it is held for the
host and the Worker does not make it, able as it is.

71 single faults planted over the whole of the change: 68 fail a test.
The three that do not change nothing that can be seen. One takes a
failure of storage in the middle of an action for being turned away
(the tests' store cannot fail in the middle of one and work again for
the next write). One drops the check the taking itself makes that a
machine does not have the action: everything that takes asks the same
thing first, and between the asking and the taking there is nothing
but the object's own storage to wait for, during which Cloudflare lets
nothing else in. One drops the limit on how many times a newer action
looks again at what is ahead of it, which cannot be reached. The
Worker's reading of the host's answer is outside those tests, so it
was turned each way in the real runtime: taking everything for "never
reached", the Worker makes the comment it should have left to the
host; believing nothing, it leaves the one it should have made. Each
fails the checks it should.

**Not done, and filed.** The 530 has not been seen in service: that
needs the owner's action to be turned away by GitHub while the laptop
is away. What it was taken for is then in the health answer. An older
action still out at the host does not hold back a newer one about the
same thing that the edge can do at once (a rank sent to the host,
then another the edge makes directly within the minute): the edge does
not keep track of askings that are out by what they are about.
2 changes: 1 addition & 1 deletion planning/roadmaps/pm-stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The roadmap of record is this file and its siblings in `planning/roadmaps/`. The
| The edge's own GitHub allowance | in-progress | The core must not stop being readable when agents have used the account's hourly allowance. | #13489 |
| Queue tasks filed, cancelled and unblocked from Cloudflare | shaped | A prompt sent with the laptop away is picked up, not only filed. | #13490 |
| Questions, what needs you and sessions with no machine | shaped | The last sections that are only as fresh as a machine's last report. | #13491 |
| What waits for a machine, done from Cloudflare once it can be | shaped | With GitHub answering again and no machine there, what the owner did is done by the edge itself and not kept waiting; never twice. | #13831 |
| What waits for a machine, done from Cloudflare once it can be | shipped | With GitHub answering again and no machine there, what the owner did is done by the edge itself and not kept waiting; never twice. | #13831 |
| The laptop's console follows main | proposed | The console on the laptop runs the build main is at, and it is seen from outside when it does not. | #13833 |

## Next
Expand Down
54 changes: 51 additions & 3 deletions pm-stack/console/edge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,56 @@ open nothing.
same issue, task, reference or set of questions) that a machine has
not taken yet, even when the machine can be reached again: sent
straight on it would be done first, and the older one would undo it.
What is about something else goes straight on. Not covered (#13398):
an older action held for a machine and a newer one about the same
thing that the edge does itself.
What is about something else goes straight on. Where the newer one is
the edge's own to do, the older held one still comes first: if a
machine has been handed it, or only a machine can do it, the newer
waits behind it; otherwise the edge does the older itself first (or,
for a rank followed by a newer rank of the same issue, drops it as
replaced: the last one wins, and only over its own kind).
- **What is held and the edge can do, it does itself when it can.**
What the owner did while the edge was turned away and no machine
could be reached is held, but it does not have to wait for a machine.
When the time GitHub gave has come, or the hour the edge leaves a
kind alone is up, or the owner says to try again, the edge wakes
itself and does what it holds of the kinds it runs: the oldest first,
and each thing's actions in the order they were done.
Nothing is done twice, by one rule: an action is one side's or the
other's. It is a machine's once it may have reached one, and the edge
never takes it then, nor anything else about the same thing. It is
the edge's once it has taken it out of the held list, which it does,
and writes down (`taken`), before it begins. A machine reporting
meanwhile is not handed it, nor what waits behind it about the same
thing. Turned away again before anything was written, the action goes
back where it was. An object put away with an action taken is settled
by the next one from its record: ended; never begun, so it waits
again; or begun and not known to have ended, which neither side does
again and the owner is told to look at. What has waited a day is
dropped whether or not a machine ever reports.
- **Only what certainly reached no machine is the edge's to do.** An
action may have reached a machine in two ways: a report's answer
handed it out, or it was sent to the host and nothing came back to
say it never arrived. The second is the common one. Asking the host
ends in an answer of the host's, in no answer at all (the time ran
out, the connection broke), or in an answer from what stands in
front of the host. Only one of those says the host never had the
request: Cloudflare's own 530 (its error 1033 for a tunnel), given
when the tunnel has no connection to send anything down. That is
what a laptop that is asleep or off looks like. Anything else (a
gateway that got no answer out of the host, a wait that ran out)
leaves it open whether the host did the thing, so the action is kept
as the host's by name: the host, which writes a name down before it
starts, is handed it when it reports and says what became of it.
Each held action carries the word `unsent` only when it is known to
have reached nobody: it never set off toward a machine, or it set
off once and that one asking was answered 530. Every setting-off is
counted under the action's name, because a device that gave up
waiting offers the same name again while the first asking may still
be out: word that the second never arrived says nothing of the first.
A held action without the word (one kept by a version from before
it, too) is a machine's. One waiting here that reached nobody is not
sent toward the host when its device offers it again; it goes on
waiting for whichever side is first. The app says which of the three
each one is ("either", "machine", "asked"), the Machines screen shows
it, and the health answer counts them.
- The storage is one Durable Object. A section larger than one stored
value is kept in pieces.
Loading