You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fed2a9b
Browse filesBrowse the repository at this point in the historyBrowse files
feat(compact): add web-fetches section to compaction manifest
Session web_history (WebEntry objects) was tracked but never surfaced in
the PreCompact manifest. When an agent fetches docs or API references
mid-session and the conversation compacts, that context was silently lost
even though the body remains on disk via the web-output cache.
Changes:
- Add _select_top_web_entries() and _format_web_entry() helpers, mirroring
the bash equivalents. Entries below _MIN_WEB_BYTES_FOR_MANIFEST (200 B)
are filtered; up to _MAX_WEB_ENTRIES (4) are ranked by recency.
- Wire a "### Web Fetches (cached body)" section into _render(), positioned
after bash history and before grep patterns.
- Update _section_budgets() to include a "web" slice (10%); reduce "files"
from 30% to 25% and "bash" from 15% to 10% to keep the total at 100%.
- Extend the early-exit check in _render() to count web_history as activity
so a session whose only content is web fetches still produces a manifest.
- Add web_bonus (+15 tokens) to compute_adaptive_budget() so sessions with
web fetches get a slightly larger budget.
- New tests in test_compact_web.py covering section emission, cache-ID
inclusion, tiny-fetch suppression, young-session suppression, status code
and truncated-marker rendering, bash+web coexistence, recency ranking,
and _select_top_web_entries/_format_web_entry unit tests.
- Update test_compact.py section-budget assertions to reflect the new 5-way
split (symbols=40%, files=25%, greps=15%, bash=10%, web=10%).
- Update test_compaction_size_budgets.py and test_new_features.py to align
with the smaller bash budget slice and the mature-tier age requirement for
bash/web sections to appear.
0 commit comments