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 — fix(fleet-dispatch): checked arithmetic on peer-declared chunk size in dechunked_len (#6512) by developing-today[bot] · Pull Request #8069 · developing-today/code

Conversation

@developing-today

@developing-today developing-today Bot commented Nov 10, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

What

dechunked_len (fleet-dispatch's chunked-response completeness checker) did raw arithmetic on the peer-declared chunk size: size + 2 for the completeness guard and the slice index, total += size for the running total. For a chunk-size line naming usize::MAX or usize::MAX - 1 that panics in debug builds and wraps in release builds, so the completeness verdict is computed from wrapped values (#6512; the #5579 rule — peer-declared sizes are never trusted).

Fix

Production code, not just the test: every arithmetic step on the declared size is now checked.

  • size.checked_add(2) — a size whose chunk + trailing CRLF cannot fit a usize reads as "not complete" (None).
  • The guard compares the buffered remainder against that checked end.
  • total.checked_add(size) — the running total is checked too.
  • The slice advances by the checked end.

A chunk-size line that cannot describe a body within the buffered remainder is therefore "not complete" in every profile — never a panic, never a completed body computed from wrapped values. Signature and caller contract unchanged; dechunk (already guarded) untouched.

Test

The characterization test salvaged from PR #7524 pinned the old overflow-panic ("must overflow-panic on usize::MAX until #6512 lands") and failed deterministically in the release-profile Nix check phase, blocking every generation build from main. It is updated deliberately, as its own comment instructed, into dechunked_len_huge_chunk_size_is_not_complete, pinning:

  • both overflow sizes (usize::MAX, usize::MAX - 1) → None via direct calls (a panic would fail the test);
  • a huge declared size after a valid first chunk → None;
  • a large-but-plausible size (16 MiB) with insufficient bytes buffered → None;
  • the existing happy-path pins unchanged.

Verified on the laptop, real crate:

  • cargo test -p fleet-dispatch (debug): 11 passed, 0 failed
  • cargo test --release -p fleet-dispatch (release): 11 passed, 0 failed

Fixes #6512. This also unblocks the #7991 deploy: fork PR opencode#2237 and pin bump #8067 are merged, but no generation could build from main while this check-phase failure stood.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
repo-worker-code-k
fix(fleet-dispatch): checked arithmetic on peer-declared chunk size i…
ee35855
…n dechunked_len (#6512)
@developing-today
developing-today Bot requested review from a team and dezren39 as code owners November 10, 2026 00:20
@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9393d863-87be-4455-a65d-e586b725101c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@developing-today
developing-today Bot merged commit 8f27f04 into main Nov 10, 2026
2 of 5 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@developing-today
developing-today Bot deleted the fix/6512-dechunked-len-checked branch November 10, 2026 00:22
This was referenced Nov 10, 2026
fleet(dispatch): dechunked_len does unchecked arithmetic on the peer-declared chunk size — overflow panics in debug, wraps in release #6512
Closed
docs(mcpx): regenerate configuration.md refdoc regions #8071
Merged
test(id-core): state the registry/catalog consistency pins against the production catalog under test-provider #8090
Merged
Fleet-stalling: workhorse route auth token expired (42 sessions failed); prompt probe returns 'Insufficient account balance' #7991
Closed
This was referenced Nov 11, 2026
Phase 4 of #6582 — closing read-site inventory: disposition every frame/peer value read in fleet-proxy + fleet-dispatch against the validated-and-bounded contract #6583
Closed
Design: validate it where you read it — one validated-and-bounded contract for the fleet proxy's frame and peer values #6582
Closed
@dezren39

dezren39 commented Nov 14, 2026

Copy link
Copy Markdown
Member

Salvage comparison from the shepherd pass on duplicate PR #8004 (same change, "Fix #6512: checked arithmetic on peer-declared chunk size in fleet-dispatch", head queue/14068-6512-dispatch-dechunk-checked @ 61bfc4a).

This PR (#8069) is the canonical landed version: ee35855 plus the salvaged probe test b3f74fd, merged 2026-11-10 (merge 8f27f04), which closed #6512. Diffing #8004's change against current main:

  • Fix #6512: checked arithmetic on peer-declared chunk size in fleet-dispatch #8004 patched dechunked_len in place with checked_add on size+2 and the running total. Main's landed version goes further: dechunk and dechunked_len both delegate to a shared parse_chunked with checked arithmetic (size.checked_add(2) guard at lib.rs:402), so the two paths cannot drift.
  • Fix #6512: checked arithmetic on peer-declared chunk size in fleet-dispatch #8004's test cases are all covered by main's pin test dechunked_len_huge_chunk_size_is_not_complete (lib.rs:1185): valid body Some(9), truncated None, 0xffffffffffffffff and 0xfffffffffffffffe declared sizes → None, huge size mid-body → None. Nothing unique to salvage from Fix #6512: checked arithmetic on peer-declared chunk size in fleet-dispatch #8004.

#8004 is being closed as superseded by this PR. Probe on current main: cargo test -p fleet-dispatch dechunked_len passes.

— repo-worker-code, lane any-b (task 17253)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Nov 14, 2026
Fix #6512: checked arithmetic on peer-declared chunk size in fleet-dispatch #8004
Closed
Closure audit: every closed issue/PR verified; unmerged branches + unpushed worktrees inventoried #7079
Open
This was referenced Nov 25, 2026
test(fleet-dispatch): salvage dechunked_len huge-size probe from closed PR #7524 (task 14201) #7978
Merged
AUDIT-7 Lane 4 — MERGED-PR-AUDIT: merged PRs since 2026-10-23 vs their spawning issues #13879
Open
@dezren39 dezren39 added the audit:complete PR fully implemented spawning issue label Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@dezren39 dezren39 Awaiting requested review from dezren39

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

audit:complete PR fully implemented spawning issue

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

fleet(dispatch): dechunked_len does unchecked arithmetic on the peer-declared chunk size — overflow panics in debug, wraps in release

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.