Adaptive resolution + live-image policy#27
Open
antra-tess wants to merge 1 commit into
Open
Conversation
Add a live-image policy to the autobiographical strategy so image payload stays bounded independently of the text horizon: - imageStripDepthTokens (default 30000): strip images deeper than this many tokens from the newest message to a "[image dropped from live context]" placeholder, even though surrounding text stays verbatim out to recentWindowTokens. Lets the text horizon (e.g. 200k) far exceed the image horizon. - maxLiveImages (default 6): hard ceiling on live images, counted newest-first, for dense bursts inside the window. Applied as a single post-pass in select() so all compile paths (legacy/hierarchical/adaptive) and KnowledgeStrategy are covered. Also corrects the per-image token estimate (1000 -> 1600) to match a 1568px image, so window math no longer under-counts. Adds test/image-stripping.test.ts (count cap, depth cutoff, disabled).
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.
Integration PR for the
feat/adaptive-resolutionbranch (21 commits ahead ofmain). The V1 scaffold landed earlier via #19, but the full feature plus subsequent work never reachedmain— this brings it all in.Adaptive resolution
AutobiographicalStrategyvia theadaptiveResolutionflag and the ingestion path.OverBudgetErrorwhen the picker is exhausted over hard budget.Compression quality
Live-image policy (new)
imageStripDepthTokens(default 30000) — strip images deeper than this many tokens from the newest message to a placeholder, even though surrounding text stays verbatim out torecentWindowTokens.maxLiveImages(default 6) — hard ceiling on live images, newest-first.select()covering all compile paths; per-image token estimate corrected 1000 → 1600.Tests
Adaptive integration coverage (branching, long-chronicle, doc+chat) + image-stripping (count cap, depth cutoff, disabled). Full suite: 117/120 pass (3 pre-existing failures unrelated to this branch).
🤖 Generated with Claude Code