Skip to content

Bugfix: Sync prompt content to store when switching tabs in agent page - #3576

Open
xuyaqist wants to merge 7 commits into
developfrom
xyq/bugfix_0803
Open

Bugfix: Sync prompt content to store when switching tabs in agent page#3576
xuyaqist wants to merge 7 commits into
developfrom
xyq/bugfix_0803

Conversation

@xuyaqist

@xuyaqist xuyaqist commented Aug 3, 2026

Copy link
Copy Markdown
Contributor
  1. 修复 agent 编辑页面切换 tab 时提示词内容未同步到 store 的问题,导致用户编辑agent信息后切换tab导致内容不保存的问题
  2. 修复A2A Server返回消息内容不完整的问题
image

Copilot AI review requested due to automatic review settings August 3, 2026 12:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses two user-facing issues in Nexent: (1) prompt edits on the agent edit page were not reliably persisted when switching tabs, and (2) A2A server responses could lose event fidelity / completeness by collapsing streaming output into plain text.

Changes:

  • Frontend: persist the current prompt tab’s form value into the agent config store before switching tabs.
  • Backend: collect and return raw SSE event objects (as application/json parts), while persisting only the final_answer text for task/message storage.
  • Tests: add unit tests covering stream event collection, part building, event coalescing, and final answer extraction.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
frontend/app/[locale]/agents/components/agentInfo/AgentGenerateDetail.tsx Saves prompt tab content to the store during tab switches to prevent losing edits.
backend/services/a2a_server_service.py Preserves raw streaming events and returns them as JSON parts; extracts final_answer for persistence.
test/backend/services/test_a2a_server_service_message.py Adds tests for new streaming/event helper methods and updated behavior expectations.
Suppressed comments (1)

backend/services/a2a_server_service.py:869

  • The terminal taskArtifact event sets lastChunk at the top level but leaves the nested artifact without lastChunk, unlike the adapter’s taskProgress format. Add artifact.lastChunk so consumers can consistently detect completion.
                data={
                    "artifact": {"parts": []},
                    "append": True,
                    "lastChunk": True,
                },

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +851 to +855
data={
"artifact": {"parts": self._build_agent_run_event_parts([chunk_data])},
"append": True,
"lastChunk": False,
},
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.00000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
backend/services/a2a_server_service.py 94.82% 1 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

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