Repository navigation
Polish tool results for chat hosts and fix compressed-body truncation - #12
Merged
Merged
Conversation
- Never treat short_text as the whole body of a deflate-compressed message (size is the compressed wire size); report decoded body_bytes. - Repeat the untrusted-content framing and next steps in structured results for hosts that show structuredContent instead of the text. - wait_for_message: richer skipped entries (from, emoji, reaction_to), thread_topic, explicit after_id/turn guidance in the description. - add_recipients takes recipients; add_to stays as a deprecated alias. - Consistent attachment types (inferred from the filename when the host records none), including list items and send results. - Accurate delivery code semantics with code_meaning. - get_thread thread_topic; reactions labelled in lists and never counted as unread while hidden. - whoami: stdio / streamable-http, no expiry in text, omit empty directory_names; resolve_address describes only configured steps. - Mention save_attachment / download URLs only where registered; neutral wording in the server instructions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On SIGINT/SIGTERM or HttpServerHandle.close(), wait_for_message returns at once with status "interrupted", the caller's after_id and a next step, instead of hanging until the client's timeout. New requests get 503 with Retry-After; other in-flight requests get a 5 s grace, then 503. The process exits within a bounded time; a second signal exits immediately. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
markmnl
force-pushed
the
connector-polish
branch
from
October 9, 2026 10:05
e3877d1 to
5fc8857
Compare
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.
Rebased onto main after #11 merged.
Fixes from a user-agent session in a chat host against a hosted deployment.
Bug fix
sizeis the compressed wire size, whileshort_textpreviews the decoded body.shortTextIsCompletetook the preview as the whole body whenever the body compressed to less than the preview cap. For example, an 807-byte body that compressed to 474 bytes came back as its first 768 bytes withbody_truncated: false. Previews of deflate messages are now never treated as complete.get_message.body_bytesand the new per-messageget_threadbody_bytesreport the decoded length. Thread truncation notes use the decoded length too. This affectsget_message, the thread pid walk,wait_for_messagebodies and the message resource.Results in chat hosts
untrusted_content_noticeis added to structured results that carry other parties' words, since hosts may showstructuredContentinstead of the text.wait_for_messageandget_threadget anextstep, andget_attachment_download_urlgets afallback.wait_for_message:from, and reactions also addemojiandreaction_to. Skipped reactions are listed in the text.thread_topic, taken from the thread lookup it already makes.after_idis the inbox high-water mark ("0"only for an empty inbox), and that each wait is a model turn.get_threadaddsthread_topic.list_messagesandlist_sentmake no extra round trips because the API returns no root topic there.add_recipientstakesrecipients.add_toremains as a deprecated alias: pass exactly one of the two.application/octet-streamon upload, but its download route infers the type from the extension. A missing or generic type is now inferred from the filename.typeis added to list items,get_message, send results and download links.delivery_statusnow describes response codes correctly: 200 means accepted, other fmsg codes are rejections, andnullmeans not recorded. It addscode_meaning. Negative host-local codes now count as pending.whoami:transportis nowstdioorstreamable-http(washttp).token_expires_atstays in the structured result, described as internal.directory_namesis omitted when empty.resolve_addressdescribes only the resolution steps the operator configured.reaction. Hidden reactions are never counted as unread, andmark_readaccepts listed reactions.save_attachmentandget_attachment_download_urlonly where those tools are registered.Graceful shutdown
HttpServerHandle.close(), an in-flightwait_for_messagereturns at once with statusinterrupted. The result carries the caller'safter_idand the next step: call again with the same after_id; no messages are lost. Previously the wait hung through a restart until the client's own timeout.503withRetry-After. Other in-flight requests get a 5-second grace period, then a503.close()over HTTP (the interrupted result arrives promptly), a stalled request getting503after the grace period, and a real child process on SIGTERM (interrupted result, exit 0 in under 3 s).Compatibility
whoami.transportchanges fromhttptostreamable-http.add_recipientsinput is nowrecipients;add_tois still accepted.Tests
short_textis the 768-byte prefix (client and tools), the structured notice andnextfields, skipped reaction details, theadd_toalias, attachment types,thread_topic, the timeout high-water mark,whoamitext and directory, hidden-reaction unread counts, delivery codes, and titles/annotations for every tool.🤖 Generated with Claude Code