Repository navigation
Make tool results harder to misread: pending threads, lineage scope, flags, addresses, redaction - #14
Merged
Merged
Conversation
…flags, addresses, redaction - wait_for_message: next (and the text) names messages from other threads that after_id moved past, with get_thread/get_message steps, before the next wait; results add pending_ids. - get_thread: scope "lineage", description/next say other replies are not included; complete describes the lineage. Thread messages add no_reply, terminal, important, added, compressed; next never suggests replying to terminal or no-reply messages. - Addresses render as code spans in text; address validation follows the spec's user-part rule and rejects backslashes, whitespace and control characters. - size is described as the wire size; message items add compressed. - Redact cloud access key ids and labelled secret access keys, more source-hosting, chat, payment and API key formats, and PGP private key blocks. - download/save_attachment add type; a missing filename lists the message's attachments. - One attachment order (filename) in every tool; delivery_status describes received messages and via; get_message, send_message and reply add thread_topic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Third round of fixes from a live chat-host tester. Text content and
structuredContentboth carry each fix. Output schemas stay open: every new field is optional and nothing is removed or renamed.A.
wait_for_messagestepped past unread messages in other threads. While a batch settles, messages from other threads are still not returned andafter_idstill moves past them. Holding the cursor back would replay the batch that was already returned. What changes:next, and the text, now name each skipped message before the "keep waiting" step. For example: "Also new and not included here: message 40 in another thread (root 40). after_id has moved past it … read it with get_thread (or get_message) "40" and reply if appropriate before waiting again. Then call wait_for_message with after_id …". Results addpending_ids, oldest first. The tool description and thechatprompt describe this behaviour.B.
get_threadreturns only the lineage. The Web API's thread routes return only the lineage and give no count of children or other replies, so other replies can't be listed. What changes:scope: "lineage".nextsay that other replies (siblings and other branches) are not included, and thatlist_messagesshows newer messages.completeis now described as "the lineage is complete".C. Escaped underscores in addresses. Addresses in text results are now code spans (
`@bob_mcp@example.com`), so they are no longer escaped as\_. A value that a code span can't hold safely still falls back to escaped text. Address validation now follows the fmsg specification's user-part rule: letters and digits, with a single.,_or-between them. Validation also rejects backslashes, spaces and control characters. The error for a backslash hints that the address may still carry Markdown escaping.D. Thread messages lacked flags. Thread messages add
no_reply,terminal,important,addedandcompressed, and results add the target'sno_reply.nextno longer suggests replying to:replyrefuses unlessallow_no_replyis set.The pid-walk fallback carries the same fields.
E.
sizewas unlabelled.sizeis now described as "body size in bytes on the wire; the compressed length when compressed is true". Message items addcompressed, and the text still says "N bytes compressed".F. Redaction missed cloud access key ids. New patterns cover:
AKIA…andASIA…key ids, including the published documentation example.glpat-tokens.xox…,xapp-…).AIza…API keys.sk_live_,rk_live_,sk_test_andwhsec_keys.The existing GitHub token pattern already covered
gho_,ghs_andghu_. Tests check that ordinary text is not redacted. The tests build token-shaped values at run time because GitHub push protection rejected the literals.G. Smaller fixes
download_attachmentaddstype, andsave_attachmentdoes too for consistency.content_typeis kept.delivery_statusdescription now covers received messages and explainsvia.get_messageaddsthread_topic, with one thread lookup made only for replies.send_messageandreplyadd it when it is known without another request; a reply below the root's direct children gets null.via: "add_to"is unchanged.Tests: new
test/result-clarity.test.tscovers A–E and G, and new redaction tests are intest/safety.test.ts. The suite has 215 tests; typecheck passes andtest/output-schemas.test.tsstill passes. The README tool table, README security notes, SECURITY.md and CHANGELOG (Unreleased) are updated.Follow-up outside this repo:
GET /fmsg/:idand the list routes in fmsg-webapi return attachments withoutORDER BYorposition. Exposingpositionthere would let clients use wire order.🤖 Generated with Claude Code