Improve CI: Add Python 3.13, optimize linting, and fix unused import#4
Merged
chopratejas merged 3 commits intochopratejas:mainfrom Jan 15, 2026
Merged
Conversation
Adds Python 3.13 to the test matrix. Optimizes CI by running linting and type checking only on Python 3.12 instead of all versions. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Build artifacts with Python 3.10 to ensure maximum compatibility and avoid accidentally using newer features in build tooling. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixes linting error F401 where ProxyConfig was imported but never used. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
chopratejas
added a commit
that referenced
this pull request
Jan 21, 2026
Improve CI: Add Python 3.13, optimize linting, and fix unused import
chopratejas
added a commit
that referenced
this pull request
Jan 24, 2026
Previously, _gemini_contents_to_messages() only extracted text parts, silently dropping non-text content like images, file references, and function calls. This caused data loss when processing multimodal content. Changes: - Add _has_non_text_parts() helper to detect inlineData, fileData, functionCall, and functionResponse parts - Modify _gemini_contents_to_messages() to return tuple of (messages, preserved_indices) tracking which content entries have non-text parts - Update all call sites to preserve non-text content entries: - handle_google_batch_create - handle_gemini_generate_content - handle_gemini_count_tokens - _store_google_batch_context - Skip compression entirely when all content has non-text parts - Restore preserved entries after compression/optimization Add comprehensive test coverage (54 tests) verifying: - Detection of all non-text part types - Correct index tracking in preserved_indices - Role mapping and message conversion - Realistic conversation flows with images, function calls, PDFs
chopratejas
added a commit
that referenced
this pull request
Jan 25, 2026
Tests verify with actual Google Gemini API calls that: - Text-only requests work normally - Image requests (inlineData) are processed correctly - Function calling works (functionCall in response) - Function response flow works (functionResponse preserved) - Mixed conversations (text + images) work through proxy All tests pass both direct to API and through Headroom proxy, confirming Gap #4 fix works end-to-end.
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.
Summary
This PR includes three improvements to the CI workflow and test suite:
ProxyConfigimport that was causing linting failuresChanges
ProxyConfigimport from compression testsBenefits
Testing
All workflows passing: https://github.com/pythoninthegrass/headroom/actions/runs/21017516162
🤖 Generated with Claude Code