Add outlook.get_conversation.v1 + binary transfer profile (ERMAIN-501) - #887
Open
bdart wants to merge 2 commits into
Open
Add outlook.get_conversation.v1 + binary transfer profile (ERMAIN-501)#887bdart wants to merge 2 commits into
bdart wants to merge 2 commits into
Conversation
hobofan
reviewed
Jul 29, 2026
Comment on lines
+55
to
+84
| `GET` is not accepted on the RPC endpoint, so JSON-RPC payloads cannot appear in | ||
| URLs, browser history, or intermediary caches. RPC responses set | ||
| `Cache-Control: no-store`. `GET` is used only on the separate binary transfer | ||
| endpoint below, whose URLs carry an opaque handle rather than any JSON-RPC | ||
| payload. | ||
|
|
||
| ## Binary transfer profile (unqualified) | ||
|
|
||
| Some results reference bytes that exceed the 262,144-byte JSON-RPC body, such as | ||
| the attachments and embedded messages of `outlook.get_conversation.v1`. Those | ||
| bytes are never base64-encoded into the JSON-RPC response. Instead the method | ||
| result carries an opaque transfer handle for each object, and the client fetches | ||
| the bytes from a separate loopback endpoint. | ||
|
|
||
| | Property | Candidate value | | ||
| | --------------------- | ------------------------------------------------------------ | | ||
| | URL | `http://127.0.0.1:23123/erato/sidecar/transfer/v1/{handle}` | | ||
| | Methods | `GET` for retrieval; `OPTIONS` for browser preflight | | ||
| | Response content type | the object's own media type, else `application/octet-stream` | | ||
| | Response size | unbounded; the 262,144-byte JSON-RPC cap does not apply | | ||
|
|
||
| A handle is minted by the sidecar inside a method result (for example an | ||
| attachment's `transferHandle`). It is opaque, unguessable, and valid only within | ||
| the same sidecar runtime that issued it; it may expire. The transfer endpoint | ||
| enforces the **same** `Host`, `Origin`, and CORS/private-network validation as | ||
| the RPC endpoint — an unlisted origin is refused identically — so a handle is | ||
| usable only from an allowlisted Erato origin. A successful `GET` returns `200` | ||
| with the exact bytes, `Content-Length`, the object's media type, and | ||
| `Cache-Control: no-store`. An unknown or expired handle returns `404`. Range | ||
| requests are not part of v1; each `GET` returns the whole object. |
Contributor
There was a problem hiding this comment.
@bdart Please don't let it add new endpoints like this one, that happen outside of JSON-RPC, as that will create a hard-to-maintain interface outside of the JSON-RPC mechanism, where we can create good versioning enforcement.
It appears that the cause for this was some arbitraty body size limit. That limit (which is likely arbitrarily enforced by client or server) should be lifted instead.
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.
What changes
Adds the
outlook.get_conversation.v1method and a binary transfer profile to the desktop-sidecar protocol contract. This is the protocol half of ERMAIN-501; the sidecar implementation is EratoLab/erato-desktop-sidecar #19, which vendors the packaged spec produced here.The method lets the Outlook add-in load a whole mail thread with bodies and any-size attachments from the local Outlook store, bypassing the
makeEwsRequestAsynccaps (~1 MB / 5 MB) that degrade Exchange SE thread loading to body-less markers.Shape (aligned to the ticket's design):
{ mailboxId, anchor: { internetMessageId }, maxMessages? }. Anchored by RFC 5322 Message-ID, not the Office.js conversationId.{ state, mailbox?, messages[], warnings[] }.stateisok|partial(maps to the add-in'sConversationFetchState);partial+ awarnings[]entry whenmaxMessagestruncates or an attachment can't be read.internetMessageId,subject,from/to/cc(recipient objects),sentAtUnixSeconds/receivedAtUnixSeconds,isDraft,conversationIndex,bodyHandle,attachments[].bodyHandle{ handle, contentType, size }— the body is not inline; it is fetched via the transfer profile, so a multi-message HTML thread can't blow the 262,144-byte JSON-RPC cap.{ name, contentType, size, isInline, contentId, sha256?, contentHandle | unavailableReason }— bytes viacontentHandle, orunavailableReasonwhen they can't be produced. Embedded messages are reported ascontentType: message/rfc822(converted, no proprietary type).Transport (
TRANSPORT.md):GET /erato/sidecar/transfer/v1/{handle}serves unbounded bytes outside the RPC cap; opaque, runtime-scoped, expirable handles; same Host/Origin/CORS/PNA validation as the RPC endpoint (ERMAIN-500).New schemas:
outlook-get-conversation-v1-{params,result},outlook/{conversation-message, message-recipient, attachment-reference, body-handle, conversation-warning}; OpenRPC method +x-erato-capability; regenerated TS + AJV validators; referenceserver.tshandler; package0.1.5.Verification
pnpm run checkgreen: prettier,validate(30 schemas + openrpc + examples + conformance),check:generated,tsc, 30 vitest tests.pnpm run package-specproduceserato-desktop-sidecar-protocol-spec-0.1.5.tgz(the artifact the sidecar vendors;release/stays gitignored).Follow-up
Reference
server.tsmocks the RPC method; a reference transfer-endpoint mock + conformance fixture for the byte profile is a deliberate follow-up (the real, tested implementation is the sidecar).🤖 Generated with Claude Code
https://claude.ai/code/session_01YNRaKxV2kk7SfPJN6sccME