Skip to content

fix: 订阅任务执行失败时前端状态展示异常#657

Open
Micro66 wants to merge 2 commits intomainfrom
human/llama-20260303-033316
Open

fix: 订阅任务执行失败时前端状态展示异常#657
Micro66 wants to merge 2 commits intomainfrom
human/llama-20260303-033316

Conversation

@Micro66
Copy link
Copy Markdown
Contributor

@Micro66 Micro66 commented Mar 3, 2026

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved error handling in subscription task execution. Errors in both streaming and callback-based execution flows are now properly detected, logged, and included in task completion events with accurate status indicators and error details for better visibility.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 3, 2026

Warning

Rate limit exceeded

@Micro66 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 57 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3e819bbb-69cf-4ff3-a926-fed26773f287

📥 Commits

Reviewing files that changed from the base of the PR and between 6d05ad3 and 6ddd4f7.

📒 Files selected for processing (1)
  • backend/app/services/subscription/unified_executor.py
📝 Walkthrough

Walkthrough

This change adds error detection and handling to the subscription executor's event processing flows. When final events indicate errors, the system now captures error details, logs warnings, sets appropriate completion statuses, and publishes TaskCompletedEvent with error information across both SSE and HTTP+Callback execution paths.

Changes

Cohort / File(s) Summary
Error Handling in Subscription Executor
backend/app/services/subscription/unified_executor.py
Added error detection in SSE and HTTP+Callback execution modes. Detects ERROR event types, captures error messages, logs warnings, sets dynamic completion status (COMPLETED or FAILED), and publishes TaskCompletedEvent with error details. Includes import for EventType from shared.models.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A hop through the error paths we go,

Detecting failures high and low,

Events complete with grace and care,

Status and message, now they're there! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title in Chinese describes fixing frontend status display anomalies when subscription task execution fails, which directly aligns with the code changes that add error handling and TaskCompletedEvent publishing for failed executions.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch human/llama-20260303-033316

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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