Skip to content

fix(orchestrator): 失败任务不再携带 result - #548

Merged
huyanxius merged 2 commits into
1024XEngineer:mainfrom
xiaocheny214:fix/545-prompt-rejected-failed-result
Aug 22, 2026
Merged

fix(orchestrator): 失败任务不再携带 result #548
huyanxius merged 2 commits into
1024XEngineer:mainfrom
xiaocheny214:fix/545-prompt-rejected-failed-result

Conversation

@xiaocheny214

@xiaocheny214 xiaocheny214 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • 修复 #545:生成角色动作节点在提示词被拒绝时弹出「非完成任务不应携带 result」。
  • 根因是 PromptRejected 分支先调用 update_result()(会把任务标为 completed 并写入 result),再调用 update_status(FAILED) 且未清空 result,SSE 最终发出 status=failed + result≠null,触发前端合同校验。
  • 新增 task_repo.fail_task(),失败时统一清空 result/result_typePromptRejected 与兜底失败路径改走该函数。

Test plan

PromptRejected 路径原先先 update_result 再标 failed,导致 SSE 发出
status=failed 且 result 非空,触发前端合同校验弹窗。新增 fail_task
统一清空 result/result_type,并在措辞门禁与兜底失败路径中使用。
@vercel

vercel Bot commented Aug 22, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
windup Ignored Ignored Preview Aug 22, 2026 4:00pm

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown

✅ 此 PR 已关联 issue,之前的提醒已自动标记为已解决。

@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.49123% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...s/ai_engine/src/windup_ai_engine/prompt/rewrite.py 97.56% 1 Missing ⚠️
...pp/src/windup_app/server/orchestrator/task_repo.py 90.90% 1 Missing ⚠️

📢 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结论

已审阅固定提交范围 86f8cd397ae074cd2cc32c6580101eeb56250ca7...7b9a6811a22848829209cd579f6681ead1a21bd4,覆盖 task_repo 的失败状态契约、动作/图片执行器失败路径及新增编排测试。当前改动将失败任务统一清空 result/result_type,避免 status=failed 携带结果;调用方的事务回滚与扣费解冻流程保持一致,未发现达到发布标准的正确性、可靠性或兼容性问题。

验证:

  • pytest tests/test_generation_orchestration.py::test_action_task_prompt_rejected_leaves_no_result tests/test_generation_orchestration.py::test_fail_task_clears_stale_result tests/test_generation_orchestration.py::test_action_task_marks_failed_on_error(3 passed)
  • ruff check(3 个变更文件通过)
  • git diff --check(通过)

View job run

经 Chat Gateway 按 lint 标准改写 custom 动作描述,失败时回退原文;
措辞门禁与拒绝逻辑保持不变。
@xiaocheny214 xiaocheny214 changed the title fix(orchestrator): 失败任务不再携带 result (#545) fix(orchestrator): 失败任务不再携带 result Aug 22, 2026
@huyanxius
huyanxius self-requested a review August 22, 2026 16:03

@huyanxius huyanxius left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

没问题

@huyanxius
huyanxius merged commit 17b25a7 into 1024XEngineer:main Aug 22, 2026
11 checks passed
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.

bug:画布节点中,调用生成角色动作节点,出现非完成任务不应该携带result

2 participants