fix(talk): address PR #741 reviewer feedback
Four targeted fixes from the AI code review: 1. TalkConversation.description: drop the misleading `str | None` union (spreed always sends `""`, never null) — type is now `str` with default `""`. 2. get_messages: guard the X-Chat-Last-Given int parse with try/except so a misbehaving proxy can't crash the read flow; logs a warning and falls back to None. 3. get_messages: clamp `limit` to [1, 200] in the client (spreed caps server-side at 200 and silently truncates) so the returned `count` always matches what was actually requested. Both client and server-tool docstrings updated to state the valid range. 4. Add an integration test covering the 32000-char message ceiling in talk_send_message — the empty-message case was already tested, the over-length case was not. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
69814f30e3
commit
b6eb7a6bb8
@@ -105,7 +105,9 @@ def configure_talk_tools(mcp: FastMCP) -> None:
|
||||
|
||||
Args:
|
||||
token: Conversation token.
|
||||
limit: Max messages per page (spreed caps at 200).
|
||||
limit: Max messages per page. Valid range is 1-200 (spreed
|
||||
caps server-side at 200); values outside this range are
|
||||
clamped. Default 50.
|
||||
last_known_message_id: Pagination cursor — pass the
|
||||
``last_known_message_id`` from the previous response to
|
||||
fetch the next (older) page.
|
||||
|
||||
Reference in New Issue
Block a user