Major Agent integration errors on my large project
Why Adding Convex Agent Breaks Your Types:
The Core Issue:
When you add ...agent.schema to your schema, the agent component introduces its own tables and type system. This fundamentally changes how TypeScript infers Id types across your ENTIRE codebase.
What's happening:
// BEFORE agent: TypeScript knows this returns Id<"childRegistry">
const child = await ctx.db.get(childId);
return child._id; //
// AFTER agent: TypeScript gets confused
const child = await ctx.db.get(childId);
return child._id; //
Why This Happens
Agent uses generic types internally - The agent component likely uses Id<string> for flexibility
Type inference changes globally - Adding agent schema affects how TypeScript analyzes your whole codebase
Convex components limitation - This is a known issue when integrating components into existing large projects
thoughts?
