GeezerVison is showing github.com — pm-console edge: do queue and GitHub operations from Cloudflare while the laptop is away · Issue #12518 · developing-today/code
pm-console edge: do queue and GitHub operations from Cloudflare while the laptop is away #12518DescriptionWhere it stands
The app is served from the Worker pm-console-edge (pm-stack/console/edge). With the laptop away it still opens, shows the last state the laptop reported (marked with its age), holds twelve kinds of action for the laptop's return, and sends notifications. It cannot read anything fresh or act at once: every read and write of the queue store and of GitHub still happens on the laptop.
What is wanted
While the laptop has not reported for about a minute, the edge reads and acts by itself where nothing on the laptop is needed:
- reads: the board (queue store), pull requests, ranked issues, the owner's prompts and their replies (GitHub);
- writes that are one call: reply to or close a prompt, comment, rank an issue, move a task;
- a new prompt: the issue is one call, but its queue task goes through
fleet queue enqueue, which is the fleet binary. Either the edge writes the task by the queue's documented contract, or the issue is filed and marked so the laptop enqueues it on return. Decide from pkgs/fleet/crates/fleet-queue and doc/agents/one-queue-claiming-work.md, not by copying SQL blind.
Design already worked out
Ops and Work (pm-stack/console/src) take a run function and a fetch. Ops.gh only ever runs fleet gh api [-X M] <path> [--input -], and the queue store is already reached by fetch. An edge run that turns those argv into GitHub REST calls, and fleet secrets get <queue token name> into a Worker secret, lets both classes run unchanged in the Durable Object. Laptop-only calls (fleet queue enqueue, systemctl, fleet bridge) answer "needs the laptop".
- Rule against doing anything twice: an action that was relayed and got no answer is only ever resolved by the laptop (it has the action's name). The edge acts by itself only on requests that arrive while the laptop is already known to be quiet, which never went to the laptop.
- Sections read directly are written into the edge's mirror; when the laptop returns its report replaces them.
- Credentials: the Worker needs the repository automation token and the queue store token as Worker secrets.
pkgs/queue-transport-alert/worker/deploy.mjs is the existing pattern (Bitwarden name -> Worker secret, nothing printed or written). Make it an explicit switch in scripts/expose.py (off by default, remembered like --edge), and have the Worker say in /console/health whether it has each, so nothing is uploaded on every run.
- A self-check the Worker runs when it gets its secrets (one direct read of each kind, result in
/console/health) proves the path without taking the laptop down.
Done when
With the console service stopped on the laptop for five minutes, the app shows a board, pull requests and prompts newer than the stop, and a reply to a prompt appears on GitHub once and is not repeated when the laptop returns. Tested the way test/edge.test.ts tests the rest: the real classes, stand-ins only for GitHub and the queue store.
Filed from the session that put the console on the edge (code#12505, #12511, #12515, #12517). Activitydeveloping-today commented on Nov 22, 2026 dezren39 commented on Nov 22, 2026
Picked up for triage under queue task 21029. Revalidating the issue and related edge work before choosing a bounded implementation slice or routing it for implementation. dezren39 commented on Nov 22, 2026
Triage: this is a substantial edge capability, not a small local defect. #12505/#12511 are merged and the architecture note explicitly leaves fresh GitHub/queue reads, direct safe actions, and laptop-away prompt handling unimplemented. The requested behavior crosses pm-stack/console/edge, Ops.gh REST adaptation, queue-store access, Worker secrets, and idempotent host/edge reconciliation. Follow-up task 21047 is queued to implement it in reviewable slices. Keep new prompt queue-task creation on the documented fleet queue contract (or explicitly defer enqueue to the laptop); do not copy SQL blindly. Acceptance remains the five-minute laptop-offline check and one-time prompt reply after laptop return. dezren39 commented on Nov 22, 2026
Triage disposition complete: the issue is open, the implementation follow-up is live as queue task 21047, and the request is sized effort/l. No local fix was made because this spans the edge Worker, queue/GitHub adapters and replay safety. dezren39 commented on Nov 22, 2026
Picked up implementation task 21047. Issue #12518 is open; related PRs #12505 and #12511 are merged and no competing live PR was named in the packet. I am taking a bounded, reviewable implementation slice from the accepted scope. dezren39 commented on Nov 22, 2026 Progress: opened PR #12548 for the first read-only slice: refresh open pull requests from GitHub after the laptop has been silent for 60 seconds. Evidence: 112 console tests pass, the edge build passes, and diff check is clean. Remaining issue scope is still open; this PR does not add fresh board/ranked-issue/prompt reads or direct actions. Next slice: add the next safe fresh read with an observable boundary and test, without enabling writes. dezren39 commented on Nov 22, 2026 Queue task 21047 — the remaining accepted scope is in PR #12579 (branch xaltha/pm-console-edge-r2, commit a9caf45bf, OPEN / MERGEABLE).
Landed: the edge runs the real Ops/Work classes in the Durable Object once the laptop has been quiet for 60s, through a new run translator (pm-stack/console/edge/src/direct.ts): fleet gh api argv become GitHub REST calls, fleet secrets get becomes a Worker secret, the queue store is reached by fetch, and every other verb answers needs the laptop. Direct reads: board, prs, priorities, asks. Direct writes: ask.send, ask.reply, ask.close, issue.comment, need.comment, issue.rank, task.move. A new prompt files its issue at the edge and holds only prompt.enqueue for the laptop (new held action, runs ops.enqueue(promptPacket(...)) on return — the queue-task contract); a reply posts once and is never repeated on return. expose.py --edge-direct on|off (default off) provisions GITHUB_TOKEN/QUEUE_TOKEN/EDGE_DIRECT; health reports the capability and an hourly self-check.
Supersedes #12548's approach: this PR is from main so it includes the PR read, and it replaces #12548's dedicated readOpenPullRequests/freshRead with Ops.prs() through the one run/fetch path. #12548 can be closed once this lands.
Verification: bun test in pm-stack/console 130 pass, 0 fail (was 110) — 13 translator tests, 6 edge integration tests (fresh reads after 60s silence; reply once, not repeated on return; prompt files once, holds only the enqueue; close/rank/need-comment/move at the edge; health + self-check; no-switch/before-quiet falls back), 1 enqueue-hook test. Edge bundles: wrangler deploy --dry-run, 126.87 KiB.
Remains: live verification — deploy (the workflow provisions no secrets), scripts/expose.py --edge-direct on, then the 5-minute stopped-service check and one real reply + one real new prompt end to end. That needs the deploy + secrets, which this seat cannot do from here. dezren39 commented on Nov 22, 2026 Codex review on PR #12579 answered — all six threads fixed, replied to, and resolved.
Fixes (commit d59a57f, branch xaltha/pm-console-edge-r2):
- P1 User-Agent:
ghApi now sends user-agent: pm-console-edge on GitHub REST requests (edge/src/direct.ts:94).
- P1 old edge configs:
edgeConfig() accepts configs missing the four new direct fields (defaults empty); direct capability is gated separately via Edge.directConfigReady, so an old stored config or old host report keeps serving the offline app instead of relaying.
- P2 persist direct choice after applying:
ensure_edge_direct writes the edge-direct marker only after the wrangler secret puts succeed, both directions — a failed run no longer suppresses retries.
- P2 failed deferred enqueue:
prompt.enqueue now throws OpError 502 on nonzero exit, so heldRunner records it failed and EdgeLink.take() acks ok: false instead of dropping the held command.
- P2 notification refresh overwrite:
Notifier.tick(skip) skips reloading the sections just read directly; directRefresh/directAct pass them.
- P2 hydrate mirror before initial failure:
directReadSection loads the durable mirror first when there is no in-memory good value, so a failed first read after a restart keeps last-good data.
Verification: bun test 134/134 (was 130, +4 new tests), scripts/test_expose.py 19/19 (+1); all 6 new tests failed pre-fix in a scratch copy and pass with the fix. No deploy attempted — live laptop-away verification still needs a deploy with secrets and the wrangler dry-run approval that timed out twice before. PR is mergeable at the new head. Nothing merged. dezren39 commented on Nov 23, 2026 Status after #12579 and #12712.
Done
Left on this issue
- The switch has not been turned on. It hands the Worker the repository automation token and the queue store token, so it is the owner's to turn; the session that wrote feat(pm-console): the owner's switch for Cloudflare acting while the laptop is away #12712 also had no way left to run anything on the laptop.
- Once it is on, the Worker checks one read of each kind by itself and the result shows on the same screen and in
/console/health (selfCheck). That covers reads with the real credentials.
- The five-minute laptop-away check in the description (fresh board, pull requests and prompts with the console stopped; one reply posted once and not repeated on return) is still to be done, by someone who can stop the console on the laptop and look at the app as the owner.
Generated by Claude Code dezren39 commented on Nov 24, 2026 Second-pass verdict (lane any-n, queue task 22217, 2026-11-24). Verified fresh: direct mode is built and deployed (#12579, #12712). /console/health reports directEnabled false, which is the intended default. Nothing further is needed to build. The remaining step is the owner's switch (More → Laptop away) that hands the Worker its two tokens; the issue states that is the owner's to turn, so this lane did not turn it on and changed nothing. Once it is on, the selfCheck result on /console/health confirms the real-credential reads. No new follow-on packet is needed. Left open for the switch and the selfCheck confirmation. Tracking: #14158. dezren39 commented on Nov 26, 2026 Merge-watch disposition (queue task 23987, 2026-11-26): PR #12548 is now closed as superseded — salvage note and full evidence on the PR: #12548 (comment)
Summary: head 18d9220f860b unchanged, CONFLICTING/DIRTY against current main 8fd0812a537e (ahead 5 / behind 4687). Its open-PR refresh slice is functionally live on main via merged PR #12579 (27c78ba58607): edge/src/direct.ts reads prs from GitHub in DIRECT_READ_SECTIONS and edge/src/edge.ts runs those direct reads while the laptop is away — the replacement you recorded here ("#12548 can be closed once this lands"). Nothing functionally unique remained to salvage. This issue stays open for its remaining owner-switch / live-verification scope. developing-today-fleet commented on Nov 27, 2026 Triage verdict — oc-code-01 (queue task 25534, 2026-11-27)
Verdict: implementation is complete; the remaining acceptance check is a hands-only operation. PR #12579 delivered and deployed edge direct mode; PR #12712 delivered the Laptop away switch. Prior verification reports /console/health has directEnabled: false by default and direct mode has not been enabled. The remaining acceptance requires enabling the switch (which supplies the Worker with repository and queue credentials) and performing the five-minute laptop-away check. This lane will not enable it or claim the live check has passed.
The only remaining action for a person is: In pm-console, open More → Laptop away and turn it on. After that, a Fleet task can verify the self-check and complete the documented five-minute scenario. This is a concrete hands item, not a request for a design decision.
developing-today-fleet commented on Nov 27, 2026 🤖 Agent note · handed off
- Agent: fleet monitor
- Session / ID: repo-fleet-monitor run 2026-11-27T17:14Z
- Found via: monitor reconciliation
- Task: Claim-evaporation repair. The last queue task for this issue, task 23987 (pr_shepherd, checkpoint stage mergeability_rechecked_superseded at 2026-11-26T14:52Z; PR feat(pm-console): refresh open PRs from edge #12548 ruled superseded by PR pm-console: run queue and GitHub operations at the edge while the laptop is away #12579), is DONE, and task 21047 is also DONE. Verified this run: no live task for issue pm-console edge: do queue and GitHub operations from Cloudflare while the laptop is away #12518 exists in the code pilot queue in queued, claimed, parked, blocked, or dep_blocked state, yet the issue still carried queue/claimed + work/assigned + status/in-progress. Those claim labels were stale and are removed. The issue keeps status/blocked + user/escalated — it remains blocked on the recorded escalation, so no fresh packet is enqueued and no queue/queued label is applied while the escalation stands.
- Expectation: effort/l item stays parked on the escalation; a fresh claim may only be made through the queue once the escalation is resolved.
- Links: task 23987 (done), task 21047 (done), PR feat(pm-console): refresh open PRs from edge #12548 (superseded), PR pm-console: run queue and GitHub operations at the edge while the laptop is away #12579
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|