Skip to content

fix(ops): chat 502/500 fixes, artifacts API, Bailian fallback - #237

Merged
Cyning12 merged 2 commits into
mainfrom
fix/ops-chat-llm-artifacts-clarify
Jul 10, 2026
Merged

fix(ops): chat 502/500 fixes, artifacts API, Bailian fallback#237
Cyning12 merged 2 commits into
mainfrom
fix/ops-chat-llm-artifacts-clarify

Conversation

@Cyning12

@Cyning12 Cyning12 commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • Extend Bailian quota error detection and production-model fallback chain so qwen3.7-plus free-tier exhaustion no longer returns 502 on POST /ops/chat/messages.
  • Map clarify short-circuit runs to route=fast for current ops_runs_route_check compatibility (API still returns route=clarify).
  • Add GET /ops/runs/{run_id}/artifacts and return artifacts: [] when ops_run_artifacts table is not migrated yet.
  • Add optional SQL migration ops_desk_p1_clarify_route.sql for future DB-level clarify route support.

Test plan

  • pytest tests/ops_desk/test_llm_usage_metrics.py -k "bailian_quota or resolve_bailian"
  • pytest tests/ops_desk/test_orchestrator_p1.py::test_get_run_artifacts_empty
  • pytest tests/ops_desk/test_orchestrator_p1.py::test_get_run_artifacts_not_found
  • pytest tests/ops/test_chat_service.py tests/ops/test_clarify.py
  • Manual: POST /api/py/ops/chat/messages returns 200 for clarify path
  • Manual: GET /api/py/ops/runs/{id}/artifacts returns 200 with empty list when table missing

Made with Cursor

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

更新:2026-07-10 04:20 UTC · tools/pr_post_ci_update_body.py

Required 全绿:是

Check Status
contract_check success
manifest_check success
pytest success

变更范围(自动统计)

文件数:10

顶层前缀 计数
api/ 5
supabase/ 2
tests/ 2
docs/ 1

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

命中路径
  • api/ops/chat_service.py
  • api/ops/llm/model_catalog.py
  • api/ops/llm/providers/openai_compatible.py
  • api/ops/runs.py
  • api/ops/store/runs.py
  • supabase/sql/ops_desk_p1_clarify_route.sql
  • supabase/sql/ops_desk_p1_clarify_route_rollback.sql
  • tests/ops_desk/test_llm_usage_metrics.py
  • tests/ops_desk/test_orchestrator_p1.py

Add GET /ops/runs/{id}/artifacts, gracefully handle missing artifacts
table, map clarify runs to fast for DB route constraint compatibility,
and improve Bailian quota detection plus production model fallback chain.

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

vercel Bot commented Jul 10, 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, Comment Jul 10, 2026 4:18am

@mergify

mergify Bot commented Jul 10, 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

Align manifest with ops_run_artifacts SQL and artifacts read API so
tech_graph manifest_check passes in CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Cyning12
Cyning12 merged commit 239eca7 into main Jul 10, 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