Skip to content

fix bugs#39

Merged
xprilion merged 2 commits intomainfrom
dev
May 3, 2026
Merged

fix bugs#39
xprilion merged 2 commits intomainfrom
dev

Conversation

@xprilion
Copy link
Copy Markdown
Owner

@xprilion xprilion commented May 3, 2026

This pull request adds support for streaming and displaying "thinking" or reasoning content from advanced LLMs (such as Claude 3.7+ and OpenAI's reasoning models) before the main assistant reply. It introduces a new ThinkingChunk type, updates backend streaming and event handling, and enhances the frontend UI to show and manage these thinking segments, including duration and collapsing/expanding the block.

Backend: Extended "thinking" support for LLMs

  • Added a ThinkingChunk type and logic to detect and stream reasoning/thinking content from compatible models (Claude 3.7+, Claude 4+, OpenAI reasoning models). (backend/openmlr/agent/types.py [1] backend/openmlr/agent/llm.py [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • Updated streaming and retry functions to yield ThinkingChunk objects as appropriate. (backend/openmlr/agent/llm.py [1] [2] [3] [4]
  • Modified the agent loop to emit thinking_chunk and thinking_end events, including timing the duration of the thinking phase and handling transitions to assistant output or tool calls. (backend/openmlr/agent/loop.py [1] [2] [3] [4]

Frontend: Thinking content UI and event handling

  • Enhanced the chat UI to display streamed thinking content as a special block, collapse it when the assistant reply or tool call starts, and show the duration of the thinking phase. Users can expand/collapse the block to review the reasoning. (frontend/src/App.tsx [1] [2] [3] frontend/src/components/MessageList.tsx [4] [5] [6] [7]
  • Updated the stop button logic to only show during active processing, not while waiting for input/approval. (frontend/src/components/InputArea.tsx frontend/src/components/InputArea.tsxL253-R254)

These changes improve transparency and user experience by surfacing the model's intermediate reasoning steps in real time.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 3, 2026

@xprilion xprilion merged commit 20f5ca1 into main May 3, 2026
6 checks passed
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.

1 participant