Skip to content

Keep image payloads out of managed context text estimates - #11

Merged
Brian Krabach (bkrabach) merged 1 commit into
mainfrom
fix/typed-image-budget
Sep 25, 2026
Merged

Brian Krabach (bkrabach) merged 1 commit into
mainfrom
fix/typed-image-budget

Conversation

@bkrabach

@bkrabach Brian Krabach (bkrabach) commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

The bundled context manager also counted typed image base64 as text, inflating running usage and triggering summaries or inline compaction for ordinary images. Use a text-only estimate for both list and single-message accounting; mark pressure diagnostics when media cost is unmeasured. The input, transcript, and image bytes remain unchanged. Quoted data URLs and tool arguments continue to count as text; no invented pixel-token allowance is added.

Found during a class-wide audit using current MODULES.md plus local/configured/community sources. Companion fixes cover context-simple and loop-streaming; context-persistent inherits the simple-context fix. Native provider validation remains responsible for actual image cost and service limits.

Validation: all 374 context-managed module tests pass, including an 8.5 MB encoded image that stays present without triggering inline compaction and typed-vs-quoted/tool-image checks. New files pass Ruff; pre-existing main-file lint findings are unchanged. Live provider acceptance remains pending.

Companion draft PRs: microsoft/amplifier-module-context-simple#46, microsoft/amplifier-module-loop-streaming#64, #11.

Text estimates are partial, not a complete-request fit guarantee. Provider-native counts, request-size validation, and actual provider errors retain authority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant