Skip to content

Fix: Enabling the opening message switch for the 'begin' operator will cause previously sent messages to be overwritten. - #19492

Merged
wangq8 merged 3 commits into
infiniflow:mainfrom
cike8899:fix-agent-prologue
Sep 10, 2026
Merged

wangq8 merged 3 commits into
infiniflow:mainfrom
cike8899:fix-agent-prologue

Conversation

@cike8899

Copy link
Copy Markdown
Contributor

Summary

Fix: Enabling the opening message switch for the 'begin' operator will cause previously sent messages to be overwritten.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: ee7384be-e019-461e-a259-e3965511e6ed

📥 Commits

Reviewing files that changed from the base of the PR and between ba3cda3 and 0df5fff.

📒 Files selected for processing (2)
  • web/src/hooks/logic-hooks.ts
  • web/src/pages/agent/form/begin-form/index.tsx

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


📝 Walkthrough

Walkthrough

The hook now preserves conversation history after user messages exist. The BeginForm mode and prologue fields now use shared form components while retaining existing labels, tooltips, conditions, and handlers.

Changes

Prologue protection

Layer / File(s) Summary
Prologue guard
web/src/hooks/logic-hooks.ts
addPrologue returns the existing message list when it contains a user message.

BeginForm field wrappers

Layer / File(s) Summary
BeginForm field wiring
web/src/pages/agent/form/begin-form/index.tsx
The mode selector, prologue switch, and prologue textarea now use RAGFlowFormItem and SwitchFormField. Existing conditions, labels, tooltips, and handlers remain in place.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: dcc123456, jinhai-cn, euvre

Merge Risk: ⚪ Minimal · up to 0df5f

This change prevents opening messages from overwriting established user conversation history while retaining BeginForm behavior through shared form components. No merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main fix: enabling the opening message switch must not overwrite previously sent messages.
Description check ✅ Passed The description includes the required Summary heading and clearly states the issue that this pull request fixes.
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.
  • Fix all pre-merge checks with AI

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

A rabbit guards the message trail
No prologue hops where users prevail
Shared fields line up neat and bright
The form now fits its frame just right
Carrots cheer the careful change
Bouncy code feels less strange

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

@cike8899
cike8899 requested a review from wangq8 September 10, 2026 07:51
@cike8899 cike8899 added the ci Continue Integration label Sep 10, 2026
@wangq8
wangq8 merged commit 23f4bb0 into infiniflow:main Sep 10, 2026
9 checks passed
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.

2 participants