Skip to content

fix(ops): chat messages 500 when artifact write hits circuit breaker - #240

Merged
Cyning12 merged 1 commit into
mainfrom
fix/ops-chat-react-artifact-circuit
Aug 5, 2026
Merged

fix(ops): chat messages 500 when artifact write hits circuit breaker#240
Cyning12 merged 1 commit into
mainfrom
fix/ops-chat-react-artifact-circuit

Conversation

@Cyning12

@Cyning12 Cyning12 commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • /api/py/ops/chat/messages ReAct/deep 收尾写 ops_run_artifacts 时若撞上 Supabase 熔断,写 artifact.write_failed 事件也会再失败并上抛,导致前端 BFF(/api/ops/chat/messages)透传 500。
  • save_artifact_with_failure_event 改为失败事件也 best-effort;熔断 / 缺表(PGRST205)不重试;react/deep 在答案落地后的 artifact/metrics 写库整体吞掉,仍返回 answer。
  • 补单测:失败事件写库失败、熔断 fail-fast。

Test plan

  • pytest tests/ops/test_artifacts.py tests/ops_desk/test_orchestrator_p1.py -q
  • 本地 POST /api/py/ops/chat/messageshello / 闲聊)返回 200(clarify/react),不再 Internal Server Error
  • PR CI 全绿后合入并部署 Python API,再验生产 https://ai-ink-brain.vercel.app/api/ops/chat/messages

Made with Cursor

CI 状态(自动 · pr-post-ci)

更新:2026-08-05 03:48 UTC · tools/pr_post_ci_update_body.py

Required 全绿:是

Check Status
contract_check success
manifest_check success
pytest success

变更范围(自动统计)

文件数:6

顶层前缀 计数
api/ 4
docs/ 1
tests/ 1

⚠ automerge 路径闸:含 api/tests/.github/workflows/ 等 — 勿打 automerge 或须人审 merge。

命中路径
  • api/ops/orchestrator/core.py
  • api/ops/react_loop.py
  • api/ops/store/artifacts.py
  • api/ops/store/runs.py
  • tests/ops/test_artifacts.py

…breaker

Swallow failure-event write errors and make react/deep post-answer store
writes best-effort so /ops/chat/messages still returns the answer.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
ai-ink-brain-api-python Ready Ready Preview Aug 5, 2026 3:46am

@mergify

mergify Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@Cyning12
Cyning12 merged commit a9f96d0 into main Aug 5, 2026
9 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.

2 participants