refactor(context): dedupe assembler.rs fetcher params and timeout boilerplate#6612
Merged
Merged
Conversation
…lerplate schedule_context_fetchers took 15 positional parameters, including 5 consecutive same-typed usize budget values already duplicated on BudgetAllocation, risking an undetected argument-order swap. It now takes alloc: &BudgetAllocation instead. Also extract a shared fetch_with_timeout helper for the timeout+warn+ fallback-to-empty-Vec boilerplate duplicated across 9 fetcher functions. fetch_graph_facts is left untouched since its three-way timeout/error/success split does not fit the shared helper. No behavior change. Closes #6573 Closes #6577
bug-ops
enabled auto-merge (squash)
July 20, 2026 20:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
schedule_context_fetcherstook 15 positional parameters, including 5 consecutive same-typedusizebudget values already duplicated onBudgetAllocation— risking an undetected argument-order swap. It now takesalloc: &BudgetAllocationinstead.fetch_with_timeouthelper for the timeout+warn+fallback-to-empty-Vecboilerplate duplicated across 9 fetcher functions incrates/zeph-context/src/assembler.rs.fetch_graph_factsis left untouched since its three-way timeout/error/success split does not fit the shared helper.Closes #6573
Closes #6577
Test plan
cargo +nightly fmt --checkcargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins(15007 passed)cargo test --doc -p zeph-contextRUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links")BudgetAllocationfield mapping is 1:1 with the original positional order at every call site (no swap)