-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(agent): always fetch latest custom tool from DB when customToolId is present #3208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: staging
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR fixes a critical version mismatch issue where the LLM received stale inline tool schemas while execution validated against the latest database schema. The fix ensures the database is always the single source of truth when Key changes:
Testing:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Agent as AgentBlockHandler
participant CT as createCustomTool
participant DB as fetchCustomToolById
participant LLM as LLM Provider
Agent->>CT: createCustomTool(tool)
alt customToolId present
CT->>DB: fetchCustomToolById(customToolId)
alt DB fetch succeeds
DB-->>CT: {schema, code, title}
Note over CT: Use DB schema & code<br/>(always latest)
else DB fetch fails
DB-->>CT: null
alt inline schema exists
Note over CT: Fallback to inline schema
else no inline schema
CT-->>Agent: return null
end
end
else no customToolId
Note over CT: Use inline schema & code
end
CT->>CT: filterSchemaForLLM(schema)
CT-->>Agent: tool definition
Agent->>LLM: executeProviderRequest(tools)
alt LLM calls tool
LLM-->>Agent: tool call
Agent->>CT: executeFunction(params)
Note over CT: Execute with DB code<br/>(same source as schema)
end
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, no comments
17cc5f7 to
273a0be
Compare
Summary
customToolIdis present, even if inline schema existsType of Change
Testing
Checklist