Repository navigation
Conversation
jiahuei
added a commit
that referenced
this pull request
Oct 29, 2026
## Summary - Adds `Molto.messages(..., citation_policy="auto")` for conditional citation buffering on translated Responses routes. It buffers text when normalized tools or history signal possible citations; otherwise text streams immediately and unexpected citations are dropped. `"buffer"` always buffers each text part, `"drop"` remains the default, and opaque transport extensions do not select automatic buffering. Native Messages and Chat upstream behavior remain unchanged. - Preserves point citations without splitting text at zero-length ranges. When no original excerpt exists, the containing block supplies the fallback `cited_text`. Existing offset validation, blank-text rejection, provider metadata, and SDK-compatible text deltas remain intact. - Extends terminal-reason coverage with normal completion and refusal, and adds coverage for automatic buffering, history, transport overrides, point citations, and SDK text iteration. - Merges `amer-hosted-web-search`, retaining its Anthropic continuation metadata, provider-specific missing/empty/placeholder ciphertext rejection, and recorded continuation coverage. No cassette contents differ from that branch. Removal of output-only missing reasoning-signature checks is tracked independently in [PR #90](#90). ## Verification - `.venv/bin/python -m pytest`: 2,293 passed in 35.78 seconds on Python 3.12.9 after separating the reasoning-output work. Tests used offline replay only. - Focused citation and terminal-reason tests: 154 passed, 267 deselected. Earlier outdated point-citation expectations were corrected before the passing full suite. - `uv run --extra lint ruff check --output-format github --config pyproject.toml .`: passed. - `uv run --extra lint ruff format --diff --config pyproject.toml .`: passed. - `npx prettier@3.8 --check .`: passed. - `git diff 4235d01 HEAD --exit-code`: passed; the final tree exactly matches the verified hosted-search-only merge. Cassettes remain unchanged relative to `amer-hosted-web-search`. - The offline replay workflow targets PRs against `main`, so PR #89 relies on the local suite above while its base remains `amer-hosted-web-search`.
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
mainindependently of the hosted web search work in PR fix: Add automatic citation buffering and preserve point citations #89.Verification
.venv/bin/python -m pytest: 1,478 passed in 25.86 seconds on Python 3.12.9, using offline replay only.PYTHONPATH=python /tmp/molto-pr89-integration/.venv/bin/python -m pytest -q tests/core/test_unsigned_reasoning.py: 12 passed. The standalone tests use local SDK collectors and the existing Responses lifecycle helper, with no hosted-search dependency.uv run --extra lint ruff check --output-format github --config pyproject.toml .: passed.uv run --extra lint ruff format --diff --config pyproject.toml .: passed; the adapted Anthropic comparison was formatted before the final check.npx prettier@3.8 --check .: passed; changed documentation also passed its focused check.git diff HEAD --check: passed. No cassette changes or new recordings.mainand removing hosted-search documentation/test-helper dependencies.