Bugfix: Sync prompt content to store when switching tabs in agent page - #3576
Open
xuyaqist wants to merge 7 commits into
Open
Bugfix: Sync prompt content to store when switching tabs in agent page#3576xuyaqist wants to merge 7 commits into
xuyaqist wants to merge 7 commits into
Conversation
xuyaqist
commented
Aug 3, 2026
Contributor
- 修复 agent 编辑页面切换 tab 时提示词内容未同步到 store 的问题,导致用户编辑agent信息后切换tab导致内容不保存的问题
- 修复A2A Server返回消息内容不完整的问题
2. 优化从Agent编辑页面返回Agent仓库的样式 3. 适配新Chat页面语音识别适配 4. 修复在Agent配置页面,当字段校验失败时也能发送后端请求的问题
Contributor
There was a problem hiding this comment.
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/jsonparts), while persisting only thefinal_answertext 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
taskArtifactevent setslastChunkat the top level but leaves the nestedartifactwithoutlastChunk, unlike the adapter’staskProgressformat. Addartifact.lastChunkso 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 Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.