Skip to content

fix: manageGateway 的 deleteRoute 操作在环境已绑定情况下返回"需要已绑定 envId"错误#649

Closed
binggg wants to merge 1 commit into
mainfrom
automation/attribution-issue-moj0kqe7-al9299-managegateway-deleteroute-envid
Closed

fix: manageGateway 的 deleteRoute 操作在环境已绑定情况下返回"需要已绑定 envId"错误#649
binggg wants to merge 1 commit into
mainfrom
automation/attribution-issue-moj0kqe7-al9299-managegateway-deleteroute-envid

Conversation

@binggg
Copy link
Copy Markdown
Member

@binggg binggg commented Apr 28, 2026

Attribution issue

  • issueId: issue_moj0kqe7_al9299
  • category: tool
  • canonicalTitle: manageGateway 的 deleteRoute 操作在环境已绑定情况下返回"需要已绑定 envId"错误
  • representativeRun: atomic-js-cloudbase-cli-routes-lifecycle/2026-04-28T19-17-44-51e14f

Automation summary

**

  • root_cause: The manageGateway and queryGateway tools were using a custom ensureGatewayEnvId function that only checked if cloudBaseOptions.envId was explicitly provided. When the environment is bound via authentication (as shown in the trace with current_env_id: "booker-eval-8g4tb1du9a5a0bf3"), the cloudBaseOptions.envId might not be set, but the envId is available through the login state or cached environment. Other tools like cloudrun.ts, permissions.ts use getEnvId from cloudbase-manager.ts which properly resolves from multiple sources, but the gateway tools were using a custom function that only checked one source.
  • changes:
  • mcp/src/tools/gateway.ts: Changed getGatewayEnvId to use getEnvId(cloudBaseOptions) instead of the custom ensureGatewayEnvId function, which resolves envId from cloudBaseOptions, cache, login state, or default env manager. Updated all 5 call sites to await the now-async function.
  • mcp/src/tools/gateway.test.ts: Added mock for getEnvId to make tests pass.
  • validation:
  • TypeScript compilation passes (npx tsc --noEmit)
  • All 9 gateway tests pass (npx vitest run src/tools/gateway.test.ts)
  • **follow_up:

Changed files

  • mcp/src/tools/gateway.test.ts
  • mcp/src/tools/gateway.ts

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@binggg
Copy link
Copy Markdown
Member Author

binggg commented Apr 28, 2026

Attribution post-PR evaluation

  • visibility: internal identifiers, run ids, and private links are intentionally omitted
  • attempt: 1
  • eval_scope: primary_only
  • overall: PASSED
  • summary: all planned evaluation cases passed
  • updated_at: 2026-04-28T20:25:55.635Z

Cases

  • [PASSED] — primary — evaluation passed

@binggg
Copy link
Copy Markdown
Member Author

binggg commented Apr 29, 2026

代码冲突了

@binggg
Copy link
Copy Markdown
Member Author

binggg commented Jun 3, 2026

Closing stale automated attribution PR. The issue has been superseded by subsequent work or is no longer actionable.

@binggg binggg closed this Jun 3, 2026
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