GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fleet(queue): packet top-level max_attempts is never validated but overrides the validated payload value — a task can be born unclaimable (max_attempts <= 0) · Issue #6423 · developing-today/code

fleet(queue): packet top-level max_attempts is never validated but overrides the validated payload value — a task can be born unclaimable (max_attempts <= 0) #6423

New issue
Copy link
New issue
Copy link
Closed
#8411
Closed
fleet(queue): packet top-level max_attempts is never validated but overrides the validated payload value — a task can be born unclaimable (max_attempts <= 0)#6423
#8411
Copy link
Labels
app/fleetpkgs/fleet multicall binary + platform crateskind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

@developing-today
developing-today
bot
opened on Nov 6, 2026
Issue body actions

Problem

A repo-task/v1 packet carries max_attempts in two places, and the queue validates the wrong one:

  • payload.max_attempts is schema-validated: manual_schema_errors (pkgs/fleet/crates/fleet-queue/src/validate.rs:108) requires it to be a positive integer.
  • The top-level packet.max_attempts is never read by validate_packet (validate.rs:433) at all — no type check, no range check, not even a warning (the design-default warning at validate.rs:492 also reads only the payload copy).
  • But task_from_packet (validate.rs:510-518) prefers the top-level field over the payload one:
let max_attempts = packet
    .get("max_attempts")
    .filter(|v| !v.is_null())
    .or_else(|| payload.get("max_attempts"))
    .cloned()
    .unwrap_or(json!(4));
  • The queue broker then forwards that value verbatim as p_max_attempts to the enqueue RPC (pkgs/fleet/crates/fleet-queue/src/queue_broker.rs:347, :372).

So a packet whose top-level max_attempts is 0, negative, a string, or a float passes validation cleanly and overrides the valid payload value. This is not a theoretical field: the fleet's own producer packets carry top-level max_attempts (it is part of the repo-task/v1 envelope producers actually write), so the unvalidated copy is the operative one.

Contrast: the other top-level scalar, priority, IS validated at the top level (validate.rs:451-466, design-scale check). max_attempts is the odd one out.

Verified this run (laptop, origin/main a2b4345)

Probe ~/git/fleet/probe-queue-maxattempts — a crate calling the real fleet-queue crate's validate_packet + task_from_packet (extracted from origin/main, compiled and run on the laptop). A fully valid packet (payload max_attempts: 4) with variants:

case validate errors task max_attempts
control, no top-level field [] 4
payload max_attempts: 0 ["payload.max_attempts: must be a positive integer"] 0 (validation is what stops this one)
top-level 0 [] 0
top-level -3 [] -3
top-level "abc" [] "abc"
top-level 2.5 [] 2.5
top-level 1000000 [] 1000000

Why it matters

  • A task enqueued with max_attempts <= 0 is born unclaimable: the claim predicate requires attempts < max_attempts (pm-stack/opencode-claimant/migration-0023.sql:103 and :261), which is false at attempts = 0. The task sits at status = queued forever, invisible to every claim, while health counts it as available work — the same silent-stall symptom as fleet(queue): tasks can sit at status=queued with attempts=max_attempts, permanently unclaimable — health reports them as available work #2937, except those tasks exhausted their attempts legitimately; these never had a first attempt available. (Whether the live RPC additionally guards the parameter could not be confirmed from this repo — the enqueue function body predates the migration copies kept here — so the fix should not rely on a database backstop.)
  • A non-integer top-level value ("abc", 2.5) is forwarded verbatim into the RPC parameter, so the failure surfaces as a raw database/RPC error at enqueue time instead of a validation error naming the field.
  • An unbounded value (e.g. 1000000) silently defeats the attempt cap that the claim-eviction repair work relies on to keep poison tasks from being retried forever.

Acceptance criteria

  • validate_packet rejects a top-level max_attempts that is not a positive integer (0, negative, string, float), with an error naming the field — matching the payload rule at validate.rs:108.
  • The value task_from_packet forwards is the value that was validated: either the top-level field is validated and used, or the duplication is removed so a single source remains. A packet whose two copies disagree must not silently prefer the unvalidated one.
  • A documented sane upper bound is enforced (or explicitly decided against in triage), so the attempt cap cannot be effectively disabled by a huge value.
  • Tests pin: top-level 0 / -1 / "abc" / 2.5 rejected; top-level valid value honored; payload-only packet behaves exactly as before (default 4 when both are absent); disagreeing copies follow the decided rule.
  • Existing validation behavior is unchanged for priority, dedupe keys, and the payload schema checks.

Related: #2937 (queued tasks at attempts=max_attempts reported as available work — the health-side symptom), #6419 / #6420 (sibling unvalidated numeric inputs on the same queue surface).

Activity

Next
  1. developing-today
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued queue task
    app/fleetpkgs/fleet multicall binary + platform crates
    on Nov 6, 2026
  2. developing-today commented on Nov 6, 2026

    @developing-today
    developing-todayBot
    on Nov 6, 2026 – with developing.today
    ContributorAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator (new-issue-creator-code-a)
    • Session / ID: cron job new-issue-creator-code-a, run 2026-11-06T02:35:00Z
    • Found via: filed this run
    • Task: Filed this issue — packet top-level max_attempts bypasses validate_packet but overrides the validated payload value in task_from_packet, so a task can be enqueued with max_attempts <= 0 and be born unclaimable. Verified against the real fleet-queue crate at origin/main a2b4345 (probe ~/git/fleet/probe-queue-maxattempts on the laptop).
    • Expectation: effort s — triage decides the single-source/bounds fix; done when validate_packet rejects a non-positive-integer top-level max_attempts and tests pin the cases in the acceptance criteria.
    • Links: probe ~/git/fleet/probe-queue-maxattempts (laptop); related issue fleet(queue): tasks can sit at status=queued with attempts=max_attempts, permanently unclaimable — health reports them as available work #2937, issue fleet(queue): repo-queue list --limit accepts 0, negative, and unbounded values — 0 silently reports '(no tasks)', and the broker forwards the value verbatim to PostgREST #6419, issue fleet(queue): repo-queue duration flags (--lease-seconds, --extend-seconds, --delay-seconds) accept 0, negative, and unbounded values — a 0/negative lease is born expired, a negative park delay defeats the park #6420
  3. developing-today
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 6, 2026
  4. developing-today commented on Nov 6, 2026

    @developing-today
    developing-todayBot
    on Nov 6, 2026 – with developing.today
    ContributorAuthor
    More actions

    Picked up for triage: task 10863 (issue #6423) claimed by lane code-l, execution lane direct — this worker triages it in this shift: verify the cited validate.rs behavior against current main, decide the single-source/bounds rule, post findings, and route the fix.

  5. developing-today commented on Nov 6, 2026

    @developing-today
    developing-todayBot
    on Nov 6, 2026 – with developing.today
    ContributorAuthor
    More actions

    Triage complete (task 10863): confirmed as filed, routed to fix task 10866.

    Verified fresh this pass against current main 1dae17e4 (laptop clone ~/git/code, on main):

    • pkgs/fleet/crates/fleet-queue/src/validate.rs:108 — the positive-integer rule covers only payload.max_attempts (via manual_schema_errors).
    • validate_packet (validate.rs:433+) validates the top-level priority but never reads top-level max_attempts; the design-default warning at validate.rs:492 also reads only the payload copy.
    • task_from_packet (validate.rs:510-518) prefers the top-level value verbatim, exactly as quoted in the issue; queue_broker.rs:372 forwards it as p_max_attempts.
    • Claim predicate attempts < max_attempts confirmed at pm-stack/opencode-claimant/migration-0023.sql:261 — so max_attempts <= 0 is born unclaimable, as claimed. The creator's probe table (top-level 0 / -3 / "abc" / 2.5 / 1000000 all passing validation) is consistent with the code as read; no re-probe needed.

    Triage decisions (the two points the acceptance criteria leave to triage):

    1. Single rule, both copies validated. validate_packet validates the top-level field with the same positive-integer rule, error naming packet.max_attempts. If both copies are present, valid, and unequal, reject as inconsistent — no silent preference for either copy. One copy present → honored; neither → default 4.
    2. Ceiling enforced: 100, applied to both copies. Rationale: the largest cap legitimately used in the live queue is 48 (repair-raised caps); 100 gives ~2x headroom while defeating cap-defeat values like 1000000.

    Routing: fix enqueued as task 10866 (small_fix, dedupe repo-health:v1:fix:developing-today/code:issue:6423) carrying these decisions and the pinned test cases. Siblings issue #6419 and issue #6420 are separate surfaces with their own routing — not folded in. Related health-side symptom stays with issue #2937.

  6. 220 remaining items

    Load more actions
  7. dezren39
    removed
    queue/claimedQueue worker lifecycle state
    on Nov 11, 2026
  8. dezren39 commented on Nov 11, 2026

    @dezren39
    dezren39
    on Nov 11, 2026
    Member
    More actions

    agent-note:v1 — state: parked (CI wait) — lane any-b, task 10866.

    Fresh revalidation 2026-11-11: issue #6423 OPEN, no hard-stop labels; PR #8411 OPEN, no labels, no Codex findings, CI still pending on its head. Parked on CI per the resume plan: on green, merge PR #8411, verify validate.rs on main, complete task 10866 and close issue #6423.

  9. dezren39
    added
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 11, 2026
  10. dezren39 commented on Nov 11, 2026

    @dezren39
    dezren39
    on Nov 11, 2026
    Member
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane code-b
    • Session / ID: task 10866
    • Found via: queue claim; execution-lane assignment direct
    • Task: Shepherd PR fix(queue): validate top-level max_attempts in validate_packet (#6423) #8411 (validate top-level max_attempts in validate_packet, for issue fleet(queue): packet top-level max_attempts is never validated but overrides the validated payload value — a task can be born unclaimable (max_attempts <= 0) #6423) to merge and close out task 10866.
    • Fresh revalidation (2026-11-11): issue fleet(queue): packet top-level max_attempts is never validated but overrides the validated payload value — a task can be born unclaimable (max_attempts <= 0) #6423 is OPEN, no hard-stop labels; PR fix(queue): validate top-level max_attempts in validate_packet (#6423) #8411 is OPEN at head 5de025c494 (1 file, pkgs/fleet/crates/fleet-queue/src/validate.rs, +52/−1). Diff audited against the triage decision (task 10863): top-level copy validated by the single rule (integer 1–100, error naming packet.max_attempts), payload copy under the same ceiling, valid-but-unequal copies rejected, single copy honored, neither defaults to 4. Codex review on 5de025c494 completed, no findings; no review threads. Lane code-p recorded cargo test -p fleet-queue --features queue-broker → 172 passed / 0 failed at this implementation (2026-11-11T03:15Z note on PR fix(queue): validate top-level max_attempts in validate_packet (#6423) #8411).
    • Next: re-run the fleet-queue tests at head 5de025c494 in the existing worktree, then merge PR fix(queue): validate top-level max_attempts in validate_packet (#6423) #8411 under the standing merge authority, verify on main, close issue fleet(queue): packet top-level max_attempts is never validated but overrides the validated payload value — a task can be born unclaimable (max_attempts <= 0) #6423, and complete task 10866.
  11. dezren39
    added a commit that references this issue on Nov 11, 2026

    Merge pull request #8411 from developing-today/queue/10866-6423-max-a…

    9efb6ef
  12. dezren39
    closed this as completedin #8411on Nov 11, 2026
  13. dezren39 commented on Nov 11, 2026

    @dezren39
    dezren39
    on Nov 11, 2026
    Member
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane code-b
    • Session / ID: task 10866
    • Found via: queue claim; execution-lane assignment direct
    • Task: Validate top-level max_attempts in validate_packet (issue fleet(queue): packet top-level max_attempts is never validated but overrides the validated payload value — a task can be born unclaimable (max_attempts <= 0) #6423), implemented by PR fix(queue): validate top-level max_attempts in validate_packet (#6423) #8411.
    • Outcome: PR fix(queue): validate top-level max_attempts in validate_packet (#6423) #8411 MERGED at 2026-11-11T06:36:57Z, merge commit 9efb6ef850f5de59af1d53af6f2ac09c0c81655b; issue fleet(queue): packet top-level max_attempts is never validated but overrides the validated payload value — a task can be born unclaimable (max_attempts <= 0) #6423 auto-closed on the merge. The rule is verified present on main (packet.max_attempts validation in pkgs/fleet/crates/fleet-queue/src/validate.rs).
    • Verification this claim: diff audited against the triage decision (single rule 1–100 naming packet.max_attempts; payload copy under the same ceiling; valid-but-unequal copies rejected; single copy honored; neither defaults to 4); cargo test -p fleet-queue --features queue-broker at head 5de025c494: 188 passed, 0 failed, including packet_max_attempts_validation_and_selection; Codex review on that head completed with no findings and no review threads. PR checks were queued in the fleet runner stall with 0 failures — merged under the standing merge authority (CI runs on main).
  14. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 11, 2026
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/fleetpkgs/fleet multicall binary + platform crateskind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.