Repository navigation
Description
Where 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 frompkgs/fleet/crates/fleet-queueand doc/agents/one-queue-claiming-work.md, not by copying SQL blind.
Design already worked out
OpsandWork(pm-stack/console/src) take arunfunction and afetch.Ops.ghonly ever runsfleet gh api [-X M] <path> [--input -], and the queue store is already reached byfetch. An edgerunthat turns those argv into GitHub REST calls, andfleet 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.mjsis the existing pattern (Bitwarden name -> Worker secret, nothing printed or written). Make it an explicit switch inscripts/expose.py(off by default, remembered like--edge), and have the Worker say in/console/healthwhether 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).
Activity
developing-today commentedon Nov 22, 2026
CODE-4615
dezren39 commentedon 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 commentedon 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.ghREST 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 commentedon 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 commentedon 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 commentedon 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.
pm-console: run queue and GitHub operations at the edge while the lap…
dezren39 commentedon Nov 22, 2026
Queue task 21047 — the remaining accepted scope is in PR #12579 (branch
xaltha/pm-console-edge-r2, commita9caf45bf, OPEN / MERGEABLE).Landed: the edge runs the real
Ops/Workclasses 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 apiargv become GitHub REST calls,fleet secrets getbecomes 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 onlyprompt.enqueuefor the laptop (new held action, runsops.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) provisionsGITHUB_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/freshReadwithOps.prs()through the one run/fetch path. #12548 can be closed once this lands.Verification:
bun testin 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 commentedon 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):
ghApinow sendsuser-agent: pm-console-edgeon GitHub REST requests (edge/src/direct.ts:94).edgeConfig()accepts configs missing the four new direct fields (defaults empty); direct capability is gated separately viaEdge.directConfigReady, so an old stored config or old host report keeps serving the offline app instead of relaying.ensure_edge_directwrites theedge-directmarker only after the wrangler secret puts succeed, both directions — a failed run no longer suppresses retries.prompt.enqueuenow throwsOpError502 on nonzero exit, soheldRunnerrecords it failed andEdgeLink.take()acksok: falseinstead of dropping the held command.Notifier.tick(skip)skips reloading the sections just read directly;directRefresh/directActpass them.directReadSectionloads 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 test134/134 (was 130, +4 new tests),scripts/test_expose.py19/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.pm-console: run queue and GitHub operations at the edge while the lap…
dezren39 commentedon Nov 23, 2026
Status after #12579 and #12712.
Done
/console/healthon the Worker showsdirectEnabled: falsewith neither token present, which is the intended state until the owner turns it on.expose.py --edge-direct onon the laptop. The script no longer needswrangleror anything else installed there: the two tokens go through Cloudflare's API with the token the script already holds. Turning it off takes the tokens away again; an attempt that fails part-way leaves the Worker holding nothing; a mode that is on gets back what the Worker has lost; runs take turns.Left on this issue
/console/health(selfCheck). That covers reads with the real credentials.Generated by Claude Code