Skip to content

Refuse a message body the realm would clip - #333

Merged
GraemeF merged 5 commits into
mainfrom
worktree-comms-fae1
Oct 22, 2026
Merged

GraemeF merged 5 commits into
mainfrom
worktree-comms-fae1

Conversation

@GraemeF

@GraemeF GraemeF commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Zulip cuts a message body that passes the realm's max_message_length and still answers success. A long post then reads back truncated while the sender sees it succeed. commy added nothing on either path, so the cut is the realm's.

The Zulip adapter now reads the realm's limit once from /register and fails post and edit with a new typed MessageRejected before anything is sent. It counts code points, as Zulip does. The memory adapter takes a configurable limit. The post tool description tells an agent to split a long body.

The refusal is port behaviour, so it is tested in the shared contract (posting and publisher modules) and runs against the memory adapter and the Zulip adapter on the in-process realm. The contract env gains messageLengthLimit, and the in-process realm reports max_message_length from /register. The Zulip adapter suite keeps only its own mechanics: counting in code points and reading the limit once.

Zulip cuts a body past its max_message_length and still answers success, so a
long post read back truncated while the sender saw it succeed. The Zulip
adapter now reads the realm's limit once and fails post and edit with a typed
MessageRejected before sending. The memory adapter takes a configurable limit
so the shared contract suite asserts the refusal.
@GraemeF
GraemeF force-pushed the worktree-comms-fae1 branch from 8595849 to b9f6b9e Compare October 22, 2026 10:42
@GraemeF
GraemeF merged commit bc02d7f into main Oct 22, 2026
2 checks passed
@GraemeF
GraemeF deleted the worktree-comms-fae1 branch October 22, 2026 17:25
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