Skip to content

release: v0.16.6 — Gemini thought_signature crash fix#8

Merged
johnnichev merged 3 commits intomainfrom
release/v0.16.6
Mar 16, 2026
Merged

release: v0.16.6 — Gemini thought_signature crash fix#8
johnnichev merged 3 commits intomainfrom
release/v0.16.6

Conversation

@johnnichev
Copy link
Copy Markdown
Owner

Summary

  • 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 (complete(), acomplete(), astream(), _format_contents() x2)
  • Tests: 2 new regression tests with non-UTF-8 binary data (total: 1642)
  • Docs: Fixed stale counts in CONTRIBUTING.md (was v0.13.0 era), README.md, AGENT.md, ARCHITECTURE.md, QUICKSTART.md, docs/README.md

Test plan

  • pytest tests/ -x -q -k "ThoughtSignature" — 19 passed
  • pytest tests/agent/test_regression.py -x -q -k "thought_signature" — 1 passed
  • pytest tests/ -x -q -k "not e2e" — 1575 passed, 0 failed
  • mkdocs build — no warnings (clean)
  • black --check / isort --check / flake8 — all clean
  • Cross-reference audit — all counts consistent

🤖 Generated with Claude Code

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 johnnichev merged commit d4fd47f into main Mar 16, 2026
1 check passed
@johnnichev johnnichev deleted the release/v0.16.6 branch March 16, 2026 18:08
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
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