♻️ refactor: createAgent uses agentModel.create directly#13871
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 35d049aa78
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The createAgent router was still going through sessionModel.create, which is a legacy path that doesn't pass all agent fields (like agencyConfig) to the agents table. Switch to agentModel.create which directly inserts into the agents table with full field support. - Add CreateAgentSchema in types package for proper input validation - Remove dependency on insertAgentSchema from database package - Remove sessionId from CreateAgentResult Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## canary #13871 +/- ##
=========================================
Coverage 66.76% 66.76%
=========================================
Files 2043 2043
Lines 174032 174015 -17
Branches 17138 20441 +3303
=========================================
- Hits 116184 116174 -10
+ Misses 57724 57717 -7
Partials 124 124
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
35d049a to
559322d
Compare
agentModel.create directly
Add @deprecated JSDoc tags to the legacy session-based agent creation path (session router, SessionService, SessionModel.create, session store, insertAgentSchema). New code should use agent.createAgent / agentModel.create directly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pass input.groupId as sessionGroupId to agentModel.create so that agents created from a sidebar folder are correctly assigned to that group. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove sessionId fallback in AddAgent.tsx and ForkAndChat.tsx - Use z.custom<T>() for agencyConfig and tts in CreateAgentSchema to match agentModel.create parameter types Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
createAgentrouter was still going throughsessionModel.create, a legacy path that doesn't pass all agent fields (likeagencyConfig) to the agents tableagentModel.createwhich directly inserts into the agents table with full field supportsessionIdfromCreateAgentResultsince sessions are no longer createdTest plan
🤖 Generated with Claude Code