channel access for draft creation
Hi,
We're building a BYO AI agent against the agents beta + MCP server. Draft creation works, but only once we pass an explicit channelId, and we'd like to understand the intended model before we build around our workaround.
Same conversation, no existing drafts, three calls back to back:
create_draft(conversationId) -> -32000: Failed to create draft reply
create_draft(conversationId, channelId=cha_AAAAA) -> -32001: You do not have access to channel cha_AAAAA
create_draft(conversationId, channelId=cha_BBBBB) -> {"draftId": "msg_...", "channelType": "gmail"}
Our reading: cha_BBBBB is one of the 13 channels list_channels returns for this agent; cha_AAAAA isn't. With no channelId, Front falls back to the conversation's own channel — also not one of the 13 — and that failure comes back as a contentless -32000 rather than the clear -32001 we get when we name the channel ourselves.
What we want is simple: the agent drafts a reply on the conversation's own channel, so the draft is addressed correctly for that thread. We don't want it drafting from a fixed address.
Questions:
- How is channel/inbox access granted to an agent? The setup wizard's permissions are per-action (
create_draft,add_comment), not per-inbox. Our agent sees 18 inboxes vialist_inboxesbut only 13 channels, and the inbox we're testing in has no channel it can use. We'd like it to be able to draft on the channels of the inboxes it's invited into. - Is
channelIdan access check rather than a sender selection on reply drafts? When we passcha_BBBBB(an unrelated shared address) the call succeeds, and the resulting draft appears in the composer addressed on the conversation's channel — notcha_BBBBB. That's the behaviour we want, but we don't want to depend on it if it's incidental. Which channel would that draft actually send from? - Should the no-
channelIdcase return-32001too? The opaque-32000cost us several hours and three wrong theories;-32001was immediately actionable.
Happy to share the workspace, agent id and conversation id directly if that helps you reproduce.
Thanks!
