Skip to content

fix: MCP 工具在 envLink 丢失时无法自动修复且错误信息不清晰#677

Open
binggg wants to merge 1 commit intomainfrom
automation/attribution-issue-mojeyve5-qvoecr-mcp-envlink
Open

fix: MCP 工具在 envLink 丢失时无法自动修复且错误信息不清晰#677
binggg wants to merge 1 commit intomainfrom
automation/attribution-issue-mojeyve5-qvoecr-mcp-envlink

Conversation

@binggg
Copy link
Copy Markdown
Member

@binggg binggg commented Apr 29, 2026

Attribution issue

  • issueId: issue_mojeyve5_qvoecr
  • category: tool
  • canonicalTitle: MCP 工具在 envLink 丢失时无法自动修复且错误信息不清晰
  • representativeRun: atomic-js-cloudbase-error-repair-mysql-not-ready/2026-04-29T02-03-40-1jclzu

Automation summary

  • root_cause: The MCP tool's error handling for MySQL operations was incomplete. When RunSql failed with error code ResourceNotFound.InstanceNotFound or 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 empty nextActions, leaving the agent without guidance on what to do next.
  • changes: Modified mcp/src/tools/databaseSQL.ts:
  1. Added a new 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")
  2. Updated error handling in handleRunQuery, handleRunStatement, and handleInitializeSchema to use the new helper function for consistent error detection
  3. Updated buildProvisionNextActions() to provide a nextAction suggesting provisionMySQL when status is "FAILED"
  4. Updated buildTaskStatusNextActions() to provide a nextAction suggesting provisionMySQL when a provision task fails (while keeping e

Changed files

  • mcp/src/tools/databaseSQL.ts

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +291 to +294
const notFoundErrorCodes = [
"FailedOperation.DataSourceNotExist",
"ResourceNotFound.InstanceNotFound",
];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@binggg
Copy link
Copy Markdown
Member Author

binggg commented Apr 29, 2026

Attribution post-PR evaluation

  • visibility: internal identifiers, run ids, and private links are intentionally omitted
  • attempt: 1
  • eval_scope: primary_only
  • overall: FAILED
  • summary: at least one planned evaluation case failed
  • updated_at: 2026-04-29T02:48:13.195Z

Cases

  • [FAILED] — primary — evaluation failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant