Title: fleet queue: resume-by-session, claim-any-task, and manual-only items · Issue #9178 · developing-today/code · GitHub
Open Graph Title: fleet queue: resume-by-session, claim-any-task, and manual-only items · Issue #9178 · developing-today/code
X Title: fleet queue: resume-by-session, claim-any-task, and manual-only items · Issue #9178 · developing-today/code
Description: fleet queue: resume-by-session, claim-any-task, and manual-only items Priority: High. Intrinsic urgency: 400. Drew directive, 2026-11-12 20:41 CST. Parent epic: #8990 (fleet tool — one door for coordination, mirroring, and backups). Why ...
Open Graph Description: fleet queue: resume-by-session, claim-any-task, and manual-only items Priority: High. Intrinsic urgency: 400. Drew directive, 2026-11-12 20:41 CST. Parent epic: #8990 (fleet tool — one door for coo...
X Description: fleet queue: resume-by-session, claim-any-task, and manual-only items Priority: High. Intrinsic urgency: 400. Drew directive, 2026-11-12 20:41 CST. Parent epic: #8990 (fleet tool — one door for coo...
Opengraph URL: https://github.com/developing-today/code/issues/9178
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fleet queue: resume-by-session, claim-any-task, and manual-only items","articleBody":"# fleet queue: resume-by-session, claim-any-task, and manual-only items\n\n**Priority: High. Intrinsic urgency: 400.** Drew directive, 2026-11-12 20:41 CST.\n\nParent epic: #8990 (fleet tool — one door for coordination, mirroring, and backups).\n\n## Why this exists\n\nThe Fleet CA design mill incident exposed a queue-semantics gap. Epic #9155's bound Summit session was stopped and queue task 15345 was parked. The eventual resume had to create a fresh OpenCode session and rebuild the design context from artifacts; roughly 600K tokens of shared context from the stopped Summit run were not recoverable through the queue because a task cannot name the session that should resume it.\n\nThe queue needs first-class support for four related operations:\n\n1. resume a task in a named OpenCode session;\n2. claim any specific task by number, including a parked or attempt-capped task, under an explicit owner override;\n3. claim several tasks under one session; and\n4. create work that automatic lanes never claim.\n\nSection 5 records a broader fleet-attribution proposal for an explicit decision. It is **not** adopted by filing this issue.\n\n## 1. Resume by session ID\n\n### Specification\n\n- Add a nullable `resume_session_id` column to the fleet-queue `tasks` table. It may be set when a task is enqueued or by an authorized later update.\n- When a worker claims a task with `resume_session_id`, the launcher must continue that OpenCode session by session ID instead of creating a new session. This builds on the session-state work in #9075 and the create-path provenance stamping in #9073.\n- Record both the requested session and the session actually used on the task's claim/attempt record. A silent substitution is not allowed.\n- Only an authorized actor may set, replace, or clear the value: the task creator, the currently bound worker/session, or an explicit operator action. Every change is audit-logged with actor, prior value, new value, time, and reason.\n- The resume hint does not override task ownership. If the task is already claimed, section 3's normal skip/take-over rules apply.\n\n### Edge cases to settle in the design and cover with tests\n\n- **Session no longer exists on the target OpenCode server:** fall back to a fresh session in the correct worktree, record `resume_fallback=missing_session` and the new session ID on the task, and surface the substitution in the claim result. Do not fail forever or repeatedly retry the missing session.\n- **Session exists in a different worktree:** never silently execute the task in the wrong tree. Either (a) require an explicit rebind action that records old worktree, new worktree, actor, and reason, or (b) fall back to a fresh session in the task's worktree and record the mismatch. The implementation issue must choose one rule and test it; silent cross-worktree execution is prohibited.\n- **Session exists but is busy/owned by another active task:** do not steal it implicitly. The claim is skipped unless the section 3 take-over path is explicitly used.\n- **Host/server restart:** the stored session ID survives in the queue. On claim, existence is checked against the target server; the missing-session fallback above applies if the server no longer knows it.\n- **No `resume_session_id`:** behavior is unchanged from today.\n\n### Acceptance criteria\n\n- [ ] Schema migration adds `resume_session_id` and the audit fields/events needed to distinguish requested session from actual session.\n- [ ] Enqueue and update paths can set/clear the column with authorization checks and audit records.\n- [ ] A claim with a live matching session continues that session; evidence from the OpenCode server shows the same session ID receiving the task prompt.\n- [ ] Missing-session, wrong-worktree, and busy-session cases each have automated tests and produce the specified recorded outcome.\n- [ ] A task without `resume_session_id` follows the existing claim path unchanged.\n\n## 2. Claim any task by number, including parked or attempt-capped tasks\n\n### Specification\n\n- Provide a fleet CLI verb for claiming one task by numeric ID. Working name: `fleet queue claim --task \u003cid>`. The final verb must follow the existing fleet queue verb conventions from #9016.\n- The claim path must be able to claim a task that is queued, parked, or at `max_attempts`. It must not pretend those states do not exist; it records an explicit **manual-claim override**.\n- The override record includes claimant identity, session ID when known, timestamp, reason, prior task status, prior `not_before`/park reason when present, and prior attempt count.\n- A manual claim does **not** silently reset the attempt history. The max-attempts gate is bypassed for this claim by the recorded override, while the historical attempts remain visible.\n- The resulting claim carries an override marker/epoch that startup and supervision logic can see. A worker booting under that manual claim must not immediately re-stop or re-park the task for the same unchanged condition that caused the earlier park. A materially new condition may still stop or park it, with that new condition recorded.\n- Repeating the same claim while the same worker/session owns it is idempotent and returns the existing claim. A claim by a different worker follows section 3's skip/take-over rules.\n\n### Acceptance criteria\n\n- [ ] A specific queued task can be claimed by ID without waiting for normal lane selection.\n- [ ] A specific parked task can be claimed by ID; the resulting task record shows the override, prior park state, actor, session, time, and reason.\n- [ ] A specific task at `max_attempts` can be claimed by ID without erasing attempt history.\n- [ ] A manually claimed task's first boot does not re-park solely for the same recorded park condition; a test reproduces the original park condition and proves the override is honored.\n- [ ] A second claim by the same owner is idempotent; an attempted claim by another owner does not disturb the live claim unless take-over is explicitly requested.\n\n## 3. Claim multiple tasks under one session\n\n### Specification\n\n- Extend the claim verb so one session can claim multiple task IDs in one operation, for example `fleet queue claim --task \u003cid1> --task \u003cid2> --session \u003csession-id>`.\n- The result is reported per task: `claimed`, `already-owned-by-this-session`, `skipped-claimed`, `not-found`, or `failed`, with the reason for each non-claim.\n- Tasks already picked up by another worker are skipped by default.\n- An explicit `--take-over` flag may claim an already-picked-up task. A take-over atomically transfers the lease/claim, ends or supersedes the prior claim according to the queue's lease rules, and records prior worker/session, new worker/session, actor, time, and reason. Where the prior worker can be signalled, it receives a hand-back/stop signal; where it cannot, that limitation is recorded.\n- Resume-by-session, parked, max-attempts, and manual-only semantics compose with batch claims: each task's override/take-over/manual authorization is independently auditable.\n\n### Acceptance criteria\n\n- [ ] One command can claim at least two unclaimed tasks for the same session and returns a per-task result.\n- [ ] Already-claimed tasks are skipped by default and their existing claims are unchanged.\n- [ ] With `--take-over`, an already-claimed task transfers to the requesting session and both sides of the transfer are audit-logged.\n- [ ] A mixed batch (unclaimed, already owned by requester, owned by another worker, missing, parked) produces the specified per-task outcomes without disturbing skipped tasks.\n\n## 4. Manual-only queue items\n\nAutomatic lanes must have a trustworthy way to leave an item alone until a person or a named session claims it. Direct-dispatch design-mill work is the immediate use case: today such work is made effectively manual by parking it or by relying on dispatch discipline, but neither state says what it means.\n\n### Options\n\n| Option | Assessment |\n|---|---|\n| Create the item as parked, then manually claim/start it | Works as a stopgap and needs no schema, but conflates “waiting for a stated condition/date” with “waiting for a human/named session.” It also inherits park semantics, including watchers and reports treating the item as stalled or blocked. |\n| Give it a very, very low priority | Not a guarantee. Priority changes, queue drains, priority boosts, and lane scope changes can all make the item claimable. It is a race, not a contract. |\n| **First-class `manual_only` / `no_auto_claim` flag (recommended)** | States the actual contract. The automatic claim query excludes the item regardless of priority. Only the explicit claim-by-ID path can claim it. The flag and every change to it are auditable. |\n\n### Recommendation and specification\n\nAdopt a first-class boolean, working name `manual_only`, on `tasks`:\n\n- The automatic claim query must exclude `manual_only = true` unconditionally; priority, age, lane, and queue depth do not change that.\n- The item remains visible in queue listings and dashboards with its manual-only state shown as an intentional state, not as parked, stalled, or blocked.\n- Only section 2's explicit claim-by-ID path can claim it. Batch claims follow the same rule per task.\n- The flag may be set at enqueue time or by an authorized later update. Setting or clearing it is audit-logged. Clearing it makes the item eligible for normal automatic claiming.\n- Migration: audit current parked-for-manual/direct-dispatch items individually and convert only those whose record shows they are waiting for a human/named session. Do not blanket-convert parked tasks; most parks mean something else.\n\n### Acceptance criteria\n\n- [ ] Schema and enqueue/update paths support `manual_only` with audit history.\n- [ ] With a manual-only item as the highest-priority and only otherwise-claimable item, an automatic lane run claims nothing.\n- [ ] The same item can be claimed through the explicit claim-by-ID path, including under a named session.\n- [ ] Queue listings distinguish manual-only from parked and blocked.\n- [ ] A migration report lists current parked-for-manual candidates and the disposition of each; no blanket conversion occurs.\n\n## 5. Proposal for decision — fleet init, run identity, and a complete transaction log\n\n**Status: proposal to decide, not an approved design.** Drew's suggestion, recorded here so the decision is explicit:\n\n> Use the fleet tool for queue and GitHub interactions. Require a fleet init step that mints a unique run/task ID and stamps everything discoverable — or require a flag/env var that ties that ID to a task or cron job. Carry the ID into GitHub operations so comments, edits, closes, and merges are attributable to the run that performed them. Log every fleet transaction to a durable log file that is backed up and can be injected into Atlas.\n\nThe motivation is concrete: the automation that labeled #9155 `status:done` and closed it during an active bound Summit run has not been identified from the GitHub surface alone. A fleet-carried run identity and transaction log would make “who stopped, merged, closed, or edited this?” a lookup instead of an investigation.\n\n### Decisions this issue must produce\n\n- [ ] **Scope:** Does “all interactions” mean all fleet-mediated queue/GitHub mutations, all GitHub operations including reads, interactive human use as well as agents/cron, or a phased scope? Which bypasses remain allowed, and how are they detected?\n- [ ] **Init contract:** What does `fleet init` mint and stamp (run ID, task ID, cron/job ID, session ID, host, worktree, repo, actor/route, start time)? What is inherited from env, the #9075 pwd-file, flags, and task claims? What happens when init is missing: fail closed for mutations, warn-and-log, or read-only mode? Is there an audited emergency bypass?\n- [ ] **GitHub carriage:** How is the run ID represented on issue/PR comments, edits, closes, and merges — pm-metadata, a hidden marker, a database mapping, or a combination — without noisy duplication on every operation?\n- [ ] **Transaction log:** Append-only local file, queue/DB table, or both? Required fields, secret-redaction rules, rotation/retention, backup target/frequency, failure behavior when logging fails, and the Atlas ingestion path/schema.\n- [ ] **Adoption boundary:** If adopted, file separate implementation issues for init/identity, GitHub carriage, and logging/backup/Atlas ingestion. If rejected or narrowed, record the rationale and the alternative attribution mechanism.\n\n### Acceptance criteria for this section\n\n- [ ] A decision record exists for the proposal (see the companion decision-records issue) stating adopted, narrowed, or rejected, with scope and rationale.\n- [ ] No implementation of fleet-init is treated as authorized merely because the proposal appears in this issue.\n- [ ] If adopted, follow-on implementation issues are filed and linked here before work begins.\n\n## Cross-links\n\n- Incident and motivating case: #9155 (queue task 15345; stopped bound Summit, parked task, fresh-session resume).\n- Session state in env + worktree pwd-file: #9075.\n- Fleet create-path Metadata/provenance stamping: #9073.\n- Higher-level fleet GitHub tools on token rotation: #9016.\n- Parent epic: #8990.\n\n## Overall acceptance\n\n- [ ] Sections 1–4 are implemented with migrations, CLI help/docs, audit records, and the tests named above.\n- [ ] Existing tasks without a resume session or manual-only flag behave exactly as before.\n- [ ] Queue docs/runbooks describe resume, manual claim, take-over, and manual-only semantics using the same terms as the CLI and task records.\n- [ ] Section 5 ends in an explicit decision record, not silent adoption or silent abandonment.\n\n\u003c!-- pm-metadata:start -->\n{\"pm_meta\": 1, \"kind\": \"feature-spec\", \"urgency\": 400, \"direct_parent\": \"#8990\", \"related\": [\"#9155\", \"#9075\", \"#9073\", \"#9016\"], \"queue_task\": 15345}\n\u003c!-- pm-metadata:end -->\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-11-13T02:43:22Z","url":"https://github.com/developing-today/code/issues/9178"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:05a23f4b-ae14-01d2-84c7-c66bd9e1a855 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BBCE:3DEF55:731DE6:951CBF:6B06265A |
| html-safe-nonce | c345097a7ddfee775d7c1bd6b38da09ed54c7542cb3d9fcbbb9d9d1247636987 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQkNFOjNERUY1NTo3MzFERTY6OTUxQ0JGOjZCMDYyNjVBIiwidmlzaXRvcl9pZCI6IjI2MjM3MDc4MDY4MDQ4Nzg5MzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7d3a67b8bb08202b8fe615541c308440287305b173dcdd9e460db1819b5a54d7 |
| hovercard-subject-tag | issue:6363552939 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/9178/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b78f6da87f9d7b490139ba80cdf9719a66dd3085f08e257f6996d771fe821167/developing-today/code/issues/9178 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b78f6da87f9d7b490139ba80cdf9719a66dd3085f08e257f6996d771fe821167/developing-today/code/issues/9178 |
| og:image:alt | fleet queue: resume-by-session, claim-any-task, and manual-only items Priority: High. Intrinsic urgency: 400. Drew directive, 2026-11-12 20:41 CST. Parent epic: #8990 (fleet tool — one door for coo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9e10bb0ecc0bd0f8692aa89586ee9b54e498d7ab9f244a44cdb5b93653a125ce |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 32e57d5cc2ce6ce92ec6dceb65858344750c27c2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width