Skip to content

Queue: file, cancel and unblock a task from Cloudflare with no machine #13490

Done

Description

@dezren39

Today. The edge files the issue of a prompt, a note or a bug itself, but the queue task that makes the fleet pick it up is a machine's: it is held (prompt.enqueue, triage.enqueue) until a machine reports and files it through the fleet binary. Cancelling and unblocking a task are a machine's too and are refused while none can be reached. So with the laptop away a prompt is filed and nobody works on it.

Why it was left. Filing a task is the fleet binary's: its keys, its de-duplication and its events are not something to copy into SQL at the edge.

What done looks like.

  • A task can be filed, cancelled and unblocked with no machine reporting, by the same rules the fleet binary applies. The route the repository already points at is the fleet's hosted front door (pkgs/fleet/hosted-worker, its queue door; impl(fleet-hosted): service skeleton — Worker route modules, RP-token auth validation, tenancy mapping, health/capabilities #12583 and the issues beside it), which is local-only today; when it is deployed the edge calls it. The alternative is the fleet's rules as a library both use.
  • With no machine reporting, a prompt sent from the app has its queue task within a minute, and Machines, "Waiting for a machine" stays empty for it.
  • task.cancel and task.unblock are done at the edge and say so on the Cloudflare screen.
  • Tests in pm-stack/console/test/edge.test.ts for each, with the machine away.

Design record: doc/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core/.


Generated by Claude Code

Acceptance criteria

  • Delivered: Queue: file, cancel and unblock a task from Cloudflare with no machine — the outcome named in the title is demonstrably in place.
  • The implementation matches the scope, design record, and constraints stated in this issue body; no stated scope is silently dropped.
  • Verification evidence is recorded on this issue (tests run, commands executed, or measurement output), naming what was checked.
  • Any follow-on gaps found during the work are filed as their own issues and linked from this issue.

Activity

  1. added
    next
    app/pm-stack
    source/agent
    app/fleet
    on Nov 23, 2026
  2. developing-today commented on Nov 23, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    Triage verdict (oc-code-08, task 22326, 2026-11-24): open, not started. The fix depends on the hosted front door (pkgs/fleet/hosted-worker queue door, #12583 and the issues beside it), which is local-only today. Routing: no local packet. Resume when that door is deployed, then the edge can call it for file, cancel and unblock.

  4. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    A route that does not copy the fleet's rules (found 2026-11-24).

    pkgs/fleet/hosted-worker/src/queue.ts is already the broker's verbs in TypeScript: executeQueueVerb(store, verb, req, env) with enqueue, cancel, unblock and the rest, a port of the native broker over a QueueStore interface (same packet validation, dedupe, work identity, events). It is synchronous and its only store today is the in-memory fixture, so it cannot be pointed at the live store as it is. The console's Worker can still use it as the one copy of the rules:

    1. Read what the verb will ask for from the queue store in one pipeline: rows with the packet's dedupe key (tasksByDedupe), live rows for the same kind and issue (what liveIdentityHolder scans allTasks for), and the mirror's labels for the issue.
    2. Run the verb against a store made of just those rows, which records what it inserts and appends (insertTask, appendEvent).
    3. Write what it wrote in one transaction, guarded so that a task filed meanwhile under the same key wins (INSERT … WHERE NOT EXISTS on the live dedupe key), and answer with the row.

    What has to be held by tests before it writes to the live queue:

    • the row the Worker would insert equals the row fleet queue enqueue --dry-run gives for the same packet (run on a machine, as the oracle), for a prompt, a triage and a bug packet;
    • a real SQLite made from pkgs/fleet/migrations takes the insert and the events, and the native binary's list/show read them back;
    • two files of the same key at once leave one task.

    Then prompt.enqueue and triage.enqueue stop being held, task.cancel and task.unblock are done at the edge the same way, and a "report" kind of ask (More → Reports, #14427) can be added: it needs nothing else.

    Not done in this session: it writes to the queue 118 lanes are working from, and deserves the oracle above before it does.


    Generated by Claude Code

  5. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    PR1 progress: #14641 now includes whole-Edge ask.send acceptance coverage (shared engine row, same-issue dedupe, transport fallback and batch-step rollback fallback). Head a87697f. Remote four-suite verification dispatched: https://github.com/dezren39/fleet/actions/runs/45505560093 (pending; not yet a pass).

    Compatibility limits are deliberately fail-to-machine: done-identity candidates require native #13091 absorption; issue.state_checked_at older than the native one-hour filing_recheck threshold requires native #12966 probing. Failed predecessor revival stays atomic and supported. A boundary regression test covers the stamp guard.

    This is Refs, not Closes: task.cancel/task.unblock remain the next slice; this PR does not complete the issue.

  6. dezren39 commented on Nov 25, 2026

    @dezren39
    MemberAuthor

    Triage verdict (xaltha lane, queue task 22326, 2026-11-25): OPEN and in progress — not resolved, and no longer blocked on the hosted front door being deployed.

    Fresh state checked this run:

    Remaining work, sized as one follow-on implementation slice (slice 2), to start once PR #14641 merges:

    • task.cancel and task.unblock done at the edge via the same queue.ts verb route, saying so on the Cloudflare screen;
    • tests in pm-stack/console/test/edge.test.ts for cancel and unblock with the machine away (the file-case tests are covered by slice 1).

    Routing: this triage packet completes with the verdict above; slice 2 is the scoped follow-on, dependent on PR #14641 merging (a code dependency, not an owner decision).

  7. added
    queue/claimed
    work/assigned
    status/in-progress
    on Nov 25, 2026
  8. 31 remaining items

  9. developing-today-fleet commented on Nov 27, 2026

    @developing-today-fleet
    Contributor

    🤖 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. Task 23779 (checkpoint stage pr_opened; PR Edge queue door: file a prompt task with no machine (slice 1, #13490) #14641 merged) and its successor task 24477 (slice 2: cancel and unblock through the edge queue door; its agent note records state=completed at 2026-11-26T23:49Z) are both DONE. Verified this run: no live task for issue Queue: file, cancel and unblock a task from Cloudflare with no machine #13490 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. The claim evaporated; labels are reset to queue/queued + status/needs-triage. A fresh triage packet was attempted this run but the queue broker refused it: work-level dedupe holds a terminal triage task and the dedupe_override flag (payload and top-level both tried) has no effect — the preserved packet sits in the fleet monitor's hidden_files (pkt-.json) and the broker dedupe-override defect is operator-flagged, so the issue currently carries queue/queued with no live task until the broker path is fixed.
    • Expectation: triage (effort/s): confirm whether any scope remains after slices 1–2; route follow-up work or close out with evidence.
    • Links: task 23779 (done), task 24477 (done), PR Edge queue door: file a prompt task with no machine (slice 1, #13490) #14641 (merged)
  10. added
    queue/queued
    status/needs-triage
    and removed
    status/in-progress
    queue/claimed
    work/assigned
    on Nov 27, 2026
  11. added
    priority/normal
    on Nov 29, 2026
  12. dezren39 commented on Nov 29, 2026

    @dezren39
    MemberAuthor

    Census note — CEN-C13, 2026-11-29

    Full body + comments re-read firsthand for the 2026-11-29 census. (Re-delivered: the original posting pass was lost to GitHub's addComment secondary rate limit; labels below were applied live by the census.)

    Verdict: stale — implemented; both slices merged. Open only for close-out confirmation (the census does not close).

    Blocker: none for the product behaviour. Fresh check by this lane: PR #15806 (slice 2) is MERGED (2026-11-27T02:15:17Z) and PR #14641 (slice 1) merged 2026-11-26. Remainder = a close-out confirmation against the body's live-behaviour acceptance items.

    Gaps: no priority label; the issue's own record never caught up with slice 2's merge — the last comment (2026-11-27 monitor note) predates it and the issue still reads as in-flight.
    Strengths: the body explains why the naive fix (copying fleet rules into SQL) was rejected; the found route (hosted-worker queue.ts verbs over a scoped store, guarded insert) is documented with its three oracle tests; slice evidence is strong (slice 1: 12+214 tests on final head; slice 2: 233 pass / 0 fail with row/event oracle).

    Labels (applied by the census): added priority/normal.

  13. added
    priority/low
    and removed
    priority/normal
    on Nov 29, 2026
  14. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Priority validation 2026-11-29 (Felix): priority/normal → priority/low — the behaviour is implemented (slice 1 PR #14641 and slice 2 PR #15806 both merged); the issue is open only for a close-out confirmation against the acceptance items.

  15. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Issue census — 2026-11-29

    Audited live on 2026-11-29 against the house label taxonomy: details, labels, blockers, priority.

    Gaps found: no ## Acceptance criteria section in the body
    Strengths found: detailed body with scope and context a picker-up can start from; links a parent issue and/or design record; active discussion: 17 recent comment(s) skimmed
    Comment skim: comments mention blocking; comments show claim/progress (17 comments in the latest page).
    Actions taken by the census: appended ## Acceptance criteria section to the body (original text unchanged).

    Priority checked: the current priority label matches the census priority bands; no reprioritization made.

  16. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    Lane 0900-BW close-out confirmation (2026-11-30) — closing with evidence.

    This is the close-out confirmation the census (CEN-C13, comment 7257777771) and the 2026-11-29 priority validation (comment 7258779759) left as this issue's sole remainder. Re-verified firsthand today, 2026-11-30:

    Against the acceptance criteria: the titled outcome (file, cancel and unblock a task from Cloudflare with no machine reporting, through the hosted-worker's queue door) is delivered by the two merged slices; the implementation follows the body's named route and design record; verification evidence is recorded on the issue; no follow-on gap was left unfiled in-thread. Closing as implemented.

  17. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    Closed as implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/fleetapp/pm-stackkind/enhancementmeta/protocol-gapnextpriority/lowqueue/queuedsource/agentstatus/needs-triageuser/review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions