Skip to content

fix(agent-conversation): stop sending inherited databaseId on message/task creates - #1832

Merged
pyramation merged 1 commit into
mainfrom
feat/agent-conversation-inherited-fields
Sep 15, 2026
Merged

pyramation merged 1 commit into
mainfrom
feat/agent-conversation-inherited-fields

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

Follow-up to constructive-io/constructive-db#3748 (constructive-planning #2045). agent_message and agent_task inherit database_id / entity_id and visibility from their agent_thread via the agent module's BEFORE INSERT trigger, and the metaschema now marks every inherited field -insert. AgentMessageInput / AgentTaskInput therefore no longer accept databaseId, and createGraphQLConversationClient was 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. loadOrCreateThread still takes databaseIdCreateAgentThreadInput is where scope is actually set.

Tests in agent-conversation and pi-host updated for the narrower options; README example brought in line with the actual Transcript/Inbox API.

Remaining caller in constructive-db (ui/desktop/src/main/services/agent-conversation.ts) drops its databaseId line 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

…/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-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@tenki-reviewer

tenki-reviewer Bot commented Sep 15, 2026

Copy link
Copy Markdown

Review complete. 🟠 1 high

💬 Inline comments (1)


This PR deletes the databaseId parameter from GraphQLConversationClientOptions and every createGraphQLConversationClient call site, shifting tenant-scope assignment for messages and tasks onto the agent module's insert triggers keyed by the owning thread. It updates the two pi-host test harnesses and the README example to the new signature. One high-severity gap surfaced: a taskParent.column === 'planId' (plan-parented) task carries no threadId, so the claimed thread-inherited scope cannot stamp database_id/entity_id/visibility, leaving those rows without resolvable tenant scope.

Files Change
agentic/agent-conversation/src/graphql-conversation.ts Removes databaseId from the client options and both mutation inputs; scope now inherited from thread.
agentic/agent-conversation/__tests__/conversation.test.ts, agentic/pi-host/__tests__/events.test.ts, agentic/pi-host/__tests__/gate.test.ts Drop the databaseId argument from all client-construction calls.
agentic/agent-conversation/README.md Updates the example to the thread-scoped constructor and documents the trigger-based inheritance.

Reviewed commit: 64a4198

@tenki-reviewer tenki-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread agentic/agent-conversation/src/graphql-conversation.ts
@pyramation
pyramation merged commit 9fc7330 into main Sep 15, 2026
21 checks passed
@pyramation
pyramation deleted the feat/agent-conversation-inherited-fields branch September 15, 2026 06:15
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