Skip to content

fix(workflow-editor): 接入真实生成任务 - #246

Open
xyh202131 wants to merge 1 commit into
1024XEngineer:mainfrom
xyh202131:fix/workflow-editor-generation-adapter
Open

fix(workflow-editor): 接入真实生成任务#246
xyh202131 wants to merge 1 commit into
1024XEngineer:mainfrom
xyh202131:fix/workflow-editor-generation-adapter

Conversation

@xyh202131

Copy link
Copy Markdown
Contributor

改动

  • 在 entities/generation 提供浏览器生产适配器,统一处理 API 前缀、会话 Token、SSE 授权恢复与既有轮询兜底
  • Workflow Editor 默认会话改用真实 GenerationApis,不再使用必然失败的占位实现
  • 补充生产适配器和 Workflow Editor 默认控制器的回归测试

范围

验证

  • npm run test:coverage:420 tests passed,Statements 88.71%,Branches 82.48%,Functions 90.75%,Lines 92.30%
  • npm run typecheck
  • npm run lint
  • npm run build
  • 变更文件 oxfmt --check

@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
windup Ready Ready Preview Aug 12, 2026 6:34pm

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
frontend/src/entities/generation/api.ts 90.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review summary

Found one authentication-recovery regression in the new production Generation adapter.

Verification note: the focused Vitest command could not start in this workspace because the local vitest executable returned Permission denied.

const headers = new Headers(init?.headers)
const accessToken = getApiAccessToken()
if (accessToken) headers.set('Authorization', `Bearer ${accessToken}`)
return fetchFn(`${resolveApiBaseUrl()}${url}`, { ...init, headers, credentials: 'include' })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

High: Route these POST/GET requests through the shared unauthorized-recovery flow (or implement the same envelope-aware retry here). The backend returns expired-token failures as HTTP 200 with { code: 401 }, so this raw fetch never calls recoverApiUnauthorized; readData immediately throws instead. As a result, opening the editor with an expired access token causes generation creation/status polling to fail even when the refresh cookie can recover the session, while the SSE path below does recover correctly.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant