Repository navigation
Open
Labels
Milestone
Description
Parent
What to build
post_chat_message posts in a heading chat as the document owner. Nothing in the stored row says a connected app wrote it. Past posts can never be marked, because no record ties a chat row to MCP.
After this change, every MCP chat post stores metadata.via = 'connected_app'. read_chat_thread reads the key back and tags those posts. So a connected app can tell its own posts from the owner's. The visible label in the pad is #344.
Acceptance criteria
- A message posted with
post_chat_messagehasmetadataequal to{"via":"connected_app"}inpublic.messages. - The value is one fixed constant,
CONNECTED_APP_VIA, inapps/hocuspocus.server/src/modules/mcp/types.ts. Noclient_idor app name is stored. -
read_chat_threadshowsvia connected appin the head line of such a post. - From
metadata,readThreadselects only named paths, never the whole object. - Composer messages have no
viakey. The pad renders an MCP post as before. - After pin, unpin and a reply,
metadata.viais still there. -
apps/hocuspocus.server/API.md§MCP connector,docs/mcp/reference.mdand the MCP entry under## [Unreleased]inapps/hocuspocus.server/CHANGELOG.mdeach state the key in one line.
Blocked by
None — can start now.
Agent brief
Type: AFK.
postMessageinapps/hocuspocus.server/src/modules/mcp/infra/chatStore.tsaddsmetadata: { via: CONNECTED_APP_VIA }. The store owns the constant, so no tool can pass another value.readThreadadds the pathvia:metadata->>via.ChatMessagegets aviaConnectedAppflag.renderChatMessageadds the tag insideframeChatText.- No migration and no
apps/webapp/src/types/supabase.tschange:messages.metadatais an existingjsonbcolumn. No insert trigger rewritesNEW.metadata.
Rules: apps/hocuspocus.server/CLAUDE.md §MCP Connector. AGENTS.md §Test Policy: no new test.
Verify: typecheck, bun test src/modules/mcp, lint and format. On the local stack, post with post_chat_message and check the row in Supabase Studio. Pin, unpin and reply, then call read_chat_thread.
Out of scope
- The visible label in the pad — Show a "via connected app" label on chat posts from a connected app #344.
- Labels in notifications, push, email, bookmarks or the pinned list.
- Any SQL change.
Activity
HMarzban commentedon Nov 23, 2026
Maintainer ruling update, 2026-11-23 — Superseded (kept open per maintainer)
Superseded for v2.4.0 by #831 (zero-leak
{ "via_agent": true }flag onpublic.messages.metadatapaired with non-Realtimepublic.message_agent_provenance, shared@docs.plus/app-trust, andDocuments.viaApp) under tracker #823. Kept open per maintainer instruction — do NOT write rawmetadata.viaor brand names intopublic.messages.metadata.