Skip to content

fix(web): honor webhook trace terminal status - #19087

Merged
JinHai-CN merged 1 commit into
infiniflow:mainfrom
T1mn:fix/agent-webhook-trace-status
Sep 1, 2026
Merged

JinHai-CN merged 1 commit into
infiniflow:mainfrom
T1mn:fix/agent-webhook-trace-status

Conversation

@T1mn

@T1mn T1mn commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Webhook trace polling marks a response as finished after any terminal event, but the sheet previously treated every finished trace without a node error as successful. This made cancelled runs, wait-for-user terminations, unsuccessful finished events, and the initial loading state appear successful.

This change:

  • keeps loading and unfinished traces in the running state;
  • reports error, cancelled, waiting-for-user, node-error, and success=false traces as failed;
  • reports success only when the trace contains an explicit successful finished event;
  • avoids findLast so the touched component remains compatible with the current TypeScript target;
  • adds focused status regression tests.

Validation:

  • 7 focused Jest tests passed;
  • formatting and lint checks passed for all touched files;
  • the touched files produce no TypeScript diagnostics. The repository-wide type check still reports existing errors in unrelated files.

@coderabbitai

coderabbitai Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: fb510097-e177-4f2d-8b20-fe10bef54fd5

📥 Commits

Reviewing files that changed from the base of the PR and between 867e418 and aed8d3d.

📒 Files selected for processing (3)
  • web/src/pages/agent/webhook-sheet/__tests__/status.test.ts
  • web/src/pages/agent/webhook-sheet/index.tsx
  • web/src/pages/agent/webhook-sheet/status.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The webhook sheet now delegates trace status classification to getWebhookTraceStatus. The helper handles running, success, and failure states, extracts failure messages, and has dedicated tests. Latest output lookup now scans events in reverse order.

Changes

Webhook trace status

Layer / File(s) Summary
Trace status helper and tests
web/src/pages/agent/webhook-sheet/status.ts, web/src/pages/agent/webhook-sheet/__tests__/status.test.ts
The helper classifies unfinished traces as running, requires an explicit successful finished event for success, and returns failure details for terminal errors. Tests cover these cases.
Webhook sheet status integration
web/src/pages/agent/webhook-sheet/index.tsx
The sheet uses getWebhookTraceStatus and finds the latest non-begin output by reversing the event list before calling find.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to aed8d

The change makes webhook traces display loading, failed, cancelled, waiting, and successful outcomes according to their terminal status. It is localized and merge-ready after normal checks, with no actionable merge-blocking risk remaining.

Poem

A rabbit checks each trace in line
Running, failing, success shine
Error messages hop along
Tests keep every state strong
The webhook sheet now knows its song

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: correcting webhook trace terminal status handling.
Description check ✅ Passed The description includes the required Summary section, explains the problem, describes the solution, and provides relevant validation results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3 files.


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.

@JinHai-CN
JinHai-CN requested a review from cike8899 September 1, 2026 06:57
@cike8899 cike8899 added the ci Continue Integration label Sep 1, 2026
@T1mn

T1mn commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@cike8899 Thank you for enabling CI. The web checks passed, while the native backend job timed out fetching the external DeepDoc test data (Test killed with quit: ran too long (11m0s)) before reaching code related to this frontend-only change. I do not have permission to rerun the upstream job; would you mind rerunning the failed check when convenient? Thank you.

@cike8899 cike8899 added ci Continue Integration and removed ci Continue Integration labels Sep 1, 2026
@JinHai-CN
JinHai-CN merged commit f486a6d into infiniflow:main Sep 1, 2026
7 of 8 checks passed
mill413 pushed a commit to mill413/ragflow that referenced this pull request Sep 3, 2026
Fix webhook trace status — cancelled/waiting-for-user/unsuccessful finishes now show as failed (were successful). Loading stays running.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants