Skip to content

refactor(context): dedupe fetcher budget-append loops via shared helper#6540

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

refactor(context): dedupe fetcher budget-append loops via shared helper#6540
bug-ops merged 1 commit into
mainfrom
feat/issue-6471/context-fetcher-budget-dedup

Conversation

@bug-ops

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

Copy link
Copy Markdown
Owner

Summary

  • fetch_semantic_recall, fetch_document_rag, fetch_summaries, and fetch_cross_session in crates/zeph-context/src/assembler.rs now build their body via the shared append_budgeted_lines helper instead of hand-rolling the same "prefix + greedily append lines until budget_tokens is exceeded" loop, matching the pattern already used by fetch_persona_facts, fetch_trajectory_hints, and fetch_tree_memory.
  • Pure internal dedup: filter predicates, entry formats, iteration order (including fetch_summaries's reverse order), and all four functions' signatures/return types/error handling/timeout logic are unchanged.
  • Updated the append_budgeted_lines doc comment to reflect all 7 current callers instead of the stale 3-caller enumeration.

Closes #6471

Test plan

  • cargo nextest run --config-file .github/nextest.toml -p zeph-context — 246/246 pass, unchanged from before the refactor
  • cargo +nightly fmt --check — clean
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings — clean
  • RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler" — clean, no broken intra-doc links
  • gitleaks protect --staged --no-banner --redact — no leaks found
  • CHANGELOG.md updated under [Unreleased]

@github-actions github-actions Bot added refactor Code refactoring without functional changes documentation Improvements or additions to documentation rust Rust code changes size/M Medium PR (51-200 lines) and removed refactor Code refactoring without functional changes labels Jul 20, 2026
@bug-ops
bug-ops enabled auto-merge (squash) July 20, 2026 02:39
fetch_semantic_recall, fetch_document_rag, fetch_summaries, and
fetch_cross_session now call the existing append_budgeted_lines helper
instead of hand-rolling the same greedy token-budget loop, matching the
pattern already used by fetch_persona_facts, fetch_trajectory_hints,
and fetch_tree_memory. Pure internal dedup, no behavior change.
@bug-ops
bug-ops force-pushed the feat/issue-6471/context-fetcher-budget-dedup branch from fe9c0f5 to f64b8dd Compare July 20, 2026 02:42
@github-actions github-actions Bot added the refactor Code refactoring without functional changes label Jul 20, 2026
@bug-ops
bug-ops merged commit cb0233a into main Jul 20, 2026
43 checks passed
@bug-ops
bug-ops deleted the feat/issue-6471/context-fetcher-budget-dedup branch July 20, 2026 02:51
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/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zeph-context: 4 fetchers duplicate append_budgeted_lines' greedy token-budget loop

1 participant