release: v0.16.6 — Gemini thought_signature crash fix#8
Merged
johnnichev merged 3 commits intomainfrom Mar 16, 2026
Merged
Conversation
Gemini 3.x returns thought_signature as opaque binary (protobuf/hash),
not UTF-8 text. The previous .decode("utf-8") crashed with
UnicodeDecodeError on non-UTF-8 bytes (e.g. 0xa4, 0xd5).
Replaced UTF-8 encode/decode with base64 encode/decode across all 5
affected locations in complete(), acomplete(), astream(), and
_format_contents(). Added regression tests with non-UTF-8 binary data.
Fix UnicodeDecodeError when Gemini 3.x returns non-UTF-8 binary thought_signature. Replaced UTF-8 encode/decode with base64 across all 5 affected code paths. 2 new regression tests (total: 1642). Also fixes stale version refs in docs/ARCHITECTURE.md (was 0.16.4), docs/README.md (was 0.16.0), and observer event count in docs/QUICKSTART.md (was 15, now 25).
- CONTRIBUTING.md: version 0.13.0→0.16.6, tests 938→1642, Python 3.9→3.13, models 120→146, tools 22→24, examples 27→38 - README.md: toolbox example description 22→24 - docs/modules/AGENT.md: observer event count 15→25
johnnichev
added a commit
that referenced
this pull request
Mar 24, 2026
Security: - Path traversal in JsonFileSessionStore — validate session_id (#9) - Unicode homoglyph bypass in injection screening — NFKD + zero-width strip + homoglyph map (#13) Data integrity: - FileKnowledgeStore._save_all() atomic write via tmp + os.replace (#10) - JsonFileSessionStore.save() atomic write (#31) Agent core: - astream() uses self._effective_model (was self.config.model) (#1) - Sync _check_policy rejects async confirm_action with clear error (#2) - Sync _streaming_call isinstance(chunk, str) guard (#18) Providers: - FallbackProvider stream()/astream() record success after consumption, not before — circuit breaker now works for streaming (#3) - Gemini response.text ValueError catch for tool-call-only responses (#4) Tools: - aexecute() uses run_in_executor(None) shared executor (#5) - execute() awaits coroutines from async tools via asyncio.run (#6) RAG: - Hybrid search O(n²) → O(1) via text_to_key dict lookup (#7) - SQLiteVectorStore thread safety + WAL mode (#8) Evals: - OutputEvaluator catches re.error on invalid regex (#11) - JsonValidityEvaluator respects expect_json=False (#12) 16 new regression tests. Full suite: 2000 passed.
johnnichev
added a commit
that referenced
this pull request
Mar 24, 2026
- Bug #2: async confirm_action guard in sync _check_policy (was overwritten by Batch 2) - Bug #8: SQLiteVectorStore WAL mode + threading.Lock (was overwritten by Batch 3) - Bug #10: FileKnowledgeStore atomic write via tmp + os.replace (was overwritten by Batch 3) - Fix SQLite test cleanup for WAL mode extra files
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
UnicodeDecodeErrorwhen Gemini 3.x returns non-UTF-8 binarythought_signature— replaced UTF-8 encode/decode with base64 across all 5 affected code paths (complete(),acomplete(),astream(),_format_contents()x2)Test plan
pytest tests/ -x -q -k "ThoughtSignature"— 19 passedpytest tests/agent/test_regression.py -x -q -k "thought_signature"— 1 passedpytest tests/ -x -q -k "not e2e"— 1575 passed, 0 failedmkdocs build— no warnings (clean)black --check/isort --check/flake8— all clean🤖 Generated with Claude Code