Conversation
…部先调用 DescribeMySQLClu (issue_mojq90qw_rpi3r0)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f8cf421b48
ℹ️ 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".
| return ( | ||
| upper.includes("DATASOURCENOTEXIST") || | ||
| upper.includes("RESOURCENOTFOUND") || | ||
| upper.includes("NOTFOUND") || |
There was a problem hiding this comment.
Narrow not-found code matching to CloudBase API errors
isNotFoundErrorCode now treats any code containing NOTFOUND as “MySQL not created”, which also matches transport errors like Node’s ENOTFOUND (DNS lookup failure). Because this helper is reused in getSqlInstanceInfo, handleRunQuery, handleRunStatement, and handleInitializeSchema, a temporary network/DNS outage can be misreported as MYSQL_NOT_CREATED and even trigger an unnecessary CreateMySQL attempt instead of surfacing the real infrastructure error.
Useful? React with 👍 / 👎.
Attribution post-PR evaluation
Cases
|
|
这条 PR 的方向是对的:先修 但从最新 post-PR eval 和 trajectory 看,这还不是完整根因。当前 case 的主要失败已经进入了下一段链路: 建议在这个 PR 里按“最小修复”继续收敛,不要扩大成重构:
这样可以保持当前 PR 的最小范围:不是重做 MySQL 工具,而是把 Serverless MySQL 的“控制面 ready”和“SQL ready”语义补齐,避免 |
Attribution issue
Automation summary
manageSqlDatabase provisionMySQLfailed when MySQL was not yet created becausegetSqlInstanceInfohad two bugs: (1)DescribeCreateMySQLResultwas not wrapped in a try-catch, so if it threw an error (e.g.,ResourceNotFound) when MySQL never existed, the error propagated unhandled and theCreateMySQLcall was never made; (2) theDescribeMySQLClusterDetailcatch only handledFailedOperation.DataSourceNotExistbut not other not-found error codes (e.g.,ClusterNotFound,ResourceNotFound), causing the error to be re-thrown instead of being treated as "instance doesn't exist"; (3) whenDescribeCreateMySQLResultreturned null/empty status (normalized toPENDING), theDescribeMySQLClusterDetailcatch incorrectly setexists: true, causinghandleProvisionMySQLto skip creating MySQL thinking it already existed.mcp/src/tools/databaseSQL.ts: (1) AddedisNotFoundErrorCodeandisNotFoundErrorMessagehelper functions that match a broad range of not-found error patterns; (2) WrappedDescribeCreateMySQLResultin a try-catch that returns{exists: false, status: "NOT_CREATED"}for not-found errors; (3) Broadened `DescribeMySQLClusterDeChanged files
mcp/src/tools/databaseSQL.test.tsmcp/src/tools/databaseSQL.ts