fix(agent-conversation): stop sending inherited databaseId on message/task creates - #1832
Conversation
…/task creates agent_message and agent_task inherit database_id / entity_id and visibility from their thread via the agent module's BEFORE INSERT trigger; constructive-db now marks those fields -insert, so the create inputs no longer accept them.
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Review complete. 🟠 1 high 💬 Inline comments (1)
This PR deletes the
Reviewed commit: 64a4198 |
There was a problem hiding this comment.
Removes the per-client databaseId option from the agent-conversation GraphQL client so tenant scope is inherited from the thread via insert triggers, updating tests and README accordingly.
Key findings
- 🟠 Plan-parented tasks lose tenant scope — graphql-conversation.ts:128
Summary
Follow-up to constructive-io/constructive-db#3748 (constructive-planning #2045).
agent_messageandagent_taskinheritdatabase_id/entity_idandvisibilityfrom theiragent_threadvia the agent module'sBEFORE INSERTtrigger, and the metaschema now marks every inherited field-insert.AgentMessageInput/AgentTaskInputtherefore no longer acceptdatabaseId, andcreateGraphQLConversationClientwas still sending it on both creates — a GraphQL validation error against the new schema.export interface GraphQLConversationClientOptions { client: GraphQLClient; - databaseId: string; threadId: string; ... } agentMessage: { -databaseId, threadId, authorRole, ...attribution, model?, parts } agentTask: { -databaseId, [parent.column]: parent.id, description, status, ... }The option is dropped rather than kept-and-ignored: the thread is the only scope carrier for a conversation, so the client never had a legitimate use for it.
loadOrCreateThreadstill takesdatabaseId—CreateAgentThreadInputis where scope is actually set.Tests in
agent-conversationandpi-hostupdated for the narrower options; README example brought in line with the actualTranscript/InboxAPI.Remaining caller in constructive-db (
ui/desktop/src/main/services/agent-conversation.ts) drops itsdatabaseIdline when it bumps@agentic-kit/agent-conversation.Link to Devin session: https://app.devin.ai/sessions/0cc6fbd1bf5946b9957c6e97f097354a
Open in Devin Desktop: https://app.devin.ai/desktop/session/0cc6fbd1bf5946b9957c6e97f097354a?variant=devin
Requested by: @pyramation