Skip to content

refactor(context): dedupe assembler.rs fetcher params and timeout boilerplate#6612

Merged
bug-ops merged 1 commit into
mainfrom
feat/issue-6573/context-fetcher-dedup
Jul 20, 2026
Merged

refactor(context): dedupe assembler.rs fetcher params and timeout boilerplate#6612
bug-ops merged 1 commit into
mainfrom
feat/issue-6573/context-fetcher-dedup

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • 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.
  • Extracted a shared fetch_with_timeout helper for the timeout+warn+fallback-to-empty-Vec boilerplate duplicated across 9 fetcher functions in crates/zeph-context/src/assembler.rs. fetch_graph_facts is left untouched since its three-way timeout/error/success split does not fit the shared helper.
  • Pure internal refactor, no behavior change.

Closes #6573
Closes #6577

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins (15007 passed)
  • cargo test --doc -p zeph-context
  • rustdoc gate (RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links")
  • Independently verified BudgetAllocation field mapping is 1:1 with the original positional order at every call site (no swap)
  • Confirmed both the timeout-fallback and real-error-propagation paths through the new helper are covered by existing tests

…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
@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Rust code changes refactor Code refactoring without functional changes size/L Large PR (201-500 lines) labels Jul 20, 2026
@bug-ops
bug-ops enabled auto-merge (squash) July 20, 2026 20:48
@bug-ops
bug-ops merged commit 35e1424 into main Jul 20, 2026
43 checks passed
@bug-ops
bug-ops deleted the feat/issue-6573/context-fetcher-dedup branch July 20, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation refactor Code refactoring without functional changes rust Rust code changes size/L Large PR (201-500 lines)

Projects

None yet

1 participant