Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9bcd71d02c
ℹ️ 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".
| const notFoundErrorCodes = [ | ||
| "FailedOperation.DataSourceNotExist", | ||
| "ResourceNotFound.InstanceNotFound", | ||
| ]; |
There was a problem hiding this comment.
Distinguish missing DB instance from missing MySQL env
Treating ResourceNotFound.InstanceNotFound as a generic "MySQL not created" signal causes false guidance when callers provide an explicit dbInstance.instanceId that does not exist. In that case MySQL may already be provisioned, but runQuery/runStatement/initializeSchema now return MYSQL_NOT_CREATED and suggest provisionMySQL, which can trigger unnecessary billable reprovision attempts instead of prompting the caller to correct the instance identifier.
Useful? React with 👍 / 👎.
Attribution post-PR evaluation
Cases
|
Attribution issue
Automation summary
RunSqlfailed with error codeResourceNotFound.InstanceNotFoundor error message "PG instance not found", the tool didn't intercept these errors and provide clear guidance. Additionally, when MySQL provisioning failed (status "FAILED"), the tool returned emptynextActions, leaving the agent without guidance on what to do next.mcp/src/tools/databaseSQL.ts:isMySQLNotFoundError()helper function that checks for known error codes (FailedOperation.DataSourceNotExist,ResourceNotFound.InstanceNotFound) and error message patterns ("database instance not found", "pg instance not found", "mysql instance not found", "instance not found")handleRunQuery,handleRunStatement, andhandleInitializeSchemato use the new helper function for consistent error detectionbuildProvisionNextActions()to provide anextActionsuggestingprovisionMySQLwhen status is "FAILED"buildTaskStatusNextActions()to provide anextActionsuggestingprovisionMySQLwhen a provision task fails (while keeping eChanged files
mcp/src/tools/databaseSQL.ts