Skip to content

feat(starter_webui): adapt Web UI for AgentScope 2.0 /chat endpoint#511

Closed
ljl3937 wants to merge 1 commit into
agentscope-ai:mainfrom
ljl3937:main
Closed

feat(starter_webui): adapt Web UI for AgentScope 2.0 /chat endpoint#511
ljl3937 wants to merge 1 commit into
agentscope-ai:mainfrom
ljl3937:main

Conversation

@ljl3937

@ljl3937 ljl3937 commented May 27, 2026

Copy link
Copy Markdown

Summary

  • Adapted starter_webui to work with AgentScope 2.0 /chat/ endpoint
  • Implemented SSE stream transformer
  • Fixed Thinking content streaming, loading state, and content display issues
  • Cleaned up all debug logging statements

Key Changes

SSE Event Transformation

  • REPLY_START: Sends response object with status: in_progress
  • THINKING_BLOCK_START/TEXT_BLOCK_START: Creates message objects with proper type field
  • THINKING_BLOCK_DELTA/TEXT_BLOCK_DELTA: Streams content and accumulates full text
  • THINKING_BLOCK_END/TEXT_BLOCK_END: Sends completed message with full content
  • REPLY_END: Builds complete output array with all messages

Bug Fixes

  1. Thinking content only showing first token
  2. Loading state not clearing
  3. Content being cleared on completion

@ljl3937 ljl3937 requested a review from a team May 27, 2026 08:40
@CLAassistant

CLAassistant commented May 27, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Add SSE transformer to convert AgentScope 2.0 streaming format to @agentscope-ai-chat expected format:
- Transform REPLY_START/END, THINKING/TEXT_BLOCK events to response/message/content objects
- Accumulate streaming deltas and send complete content in message completed events
- Track message types (reasoning/message) to preserve correct UI rendering
- Handle REPLY_START/END ID mismatch by tracking response ID

Fix UI loading state issues:
- Thinking content now streams correctly with proper content type (text instead of reasoning)
- Message completed events include full accumulated content to pass useChatRequest guard condition
- Response completed events include complete output with proper message structure

🤖 Generated with [Qoder][https://qoder.com]
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