I have read and followed all the instructions provided in the README.md.
I am on the latest version of both Open WebUI and Ollama.
I have included the browser console logs.
I have included the Docker container logs.
I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.
Expected Behavior:
Thinking tab should only be created once and should update multiple times with new data/information.
Actual Behavior:
The thinking tab was created for each step I believe.
Description
Bug Summary:
When asking R1 for some assistance with a bug I was having with C# code. I wanted a larger context length and potential response so I increased the 2 settings num_keep/num_predict. After doing so the AI/UI proceeded to bug out and create many many many thinking tabs. It ran for quite a long time and I didn't allow it finish it's response as it ran longer than 10 minutes.
Reproduction Details
Steps to Reproduce:
Increase num_keep/num_predict:
Num_keep: 1002776
Num_predict: 20000
My exact prompt:
CanyouhelpmefixmyzoomingfunctionalityinC#?Currentlyitzoomsinbutthecrosshairdoesn'trendercorrectlywhenzoomedinnordoesthelabelmatchwherewearedrawingwhenzoomedinwhenwezoombackout.Ifwecreatealabelbeforezoominginitdoesn'tstayinplacewhereitshouldbewhichispartoftheproblem.C#Code:// ZoomprivatefloatzoomFactor=1.0f;privateconstfloatzoomStep=0.1f;privatePointzoomCenter=Point.Empty;privateMatrixtransformMatrix=newMatrix();privatevoidResizeLabel(LabelDatalabel,ResizeHandleTypehandleType,PointmousePos){intx=label.Rect.X;inty=label.Rect.Y;intwidth=label.Rect.Width;intheight=label.Rect.Height;switch(handleType){caseResizeHandleType.TopLeft:width+=x-mousePos.X;height+=y-mousePos.Y;x=mousePos.X;y=mousePos.Y;break;caseResizeHandleType.TopRight:width=mousePos.X-x;height+=y-mousePos.Y;y=mousePos.Y;break;caseResizeHandleType.BottomLeft:width+=x-mousePos.X;x=mousePos.X;height=mousePos.Y-y;break;caseResizeHandleType.BottomRight:width=mousePos.X-x;height=mousePos.Y-y;break;caseResizeHandleType.Left:width+=x-mousePos.X;x=mousePos.X;break;caseResizeHandleType.Right:width=mousePos.X-x;break;caseResizeHandleType.Top:height+=y-mousePos.Y;y=mousePos.Y;break;caseResizeHandleType.Bottom:height=mousePos.Y-y;break;}label.Rect=newRectangle(x,y,Math.Max(10,width),Math.Max(10,height));}privateResizeHandleTypeGetResizeHandle(PointmousePos,Rectanglerect){ints=resizeHandleSize;Rectangle[]handles={newRectangle(rect.Left-s,rect.Top-s,s2,s2),// Top LeftnewRectangle(rect.Right-s,rect.Top-s,s2,s2),// Top RightnewRectangle(rect.Left-s,rect.Bottom-s,s2,s2),// Bottom LeftnewRectangle(rect.Right-s,rect.Bottom-s,s2,s2),// Bottom RightnewRectangle(rect.Left-s,rect.Top+rect.Height/2-s,s2,s2),// LeftnewRectangle(rect.Right-s,rect.Top+rect.Height/2-s,s2,s2),// RightnewRectangle(rect.Left+rect.Width/2-s,rect.Top-s,s2,s2),// TopnewRectangle(rect.Left+rect.Width/2-s,rect.Bottom-s,s2,s2)// Bottom};ResizeHandleType[]types={ResizeHandleType.TopLeft,ResizeHandleType.TopRight,ResizeHandleType.BottomLeft,ResizeHandleType.BottomRight,ResizeHandleType.Left,ResizeHandleType.Right,ResizeHandleType.Top,ResizeHandleType.Bottom};for(inti=0;i<handles.Length;i++){if(handles[i].Contains(mousePos))returntypes[i];}returnResizeHandleType.None;}privatevoidDrawResizeHandles(Graphicsg,Rectanglerect){ints=resizeHandleSize;Rectangle[]handles={newRectangle(rect.Left-s,rect.Top-s,s_2,s_2),// Top LeftnewRectangle(rect.Right-s,rect.Top-s,s_2,s_2),// Top RightnewRectangle(rect.Left-s,rect.Bottom-s,s_2,s_2),// Bottom LeftnewRectangle(rect.Right-s,rect.Bottom-s,s_2,s_2),// Bottom RightnewRectangle(rect.Left-s,rect.Top+rect.Height/2-s,s_2,s_2),// LeftnewRectangle(rect.Right-s,rect.Top+rect.Height/2-s,s_2,s_2),// RightnewRectangle(rect.Left+rect.Width/2-s,rect.Top-s,s_2,s_2),// TopnewRectangle(rect.Left+rect.Width/2-s,rect.Bottom-s,s_2,s_2)// Bottom};foreach(varhandleinhandles){g.FillRectangle(Brushes.Black,handle);}}privatevoidDrawCrosshair(Graphicsg){if(cursorPosition==Point.Empty)return;usingPencrosshairPen=new(crosshairColor,crosshairSize);// Draw horizontal lineg.DrawLine(crosshairPen,newPoint(0,cursorPosition.Y),newPoint(LoadedImage.Width,cursorPosition.Y));// Draw vertical lineg.DrawLine(crosshairPen,newPoint(cursorPosition.X,0),newPoint(cursorPosition.X,LoadedImage.Height));}// Adjusts a rectangle based on the current zoom transformationprivateRectangleTransformRectangle(Rectanglerect){returnnewRectangle((int)(rect.X*zoomFactor),(int)(rect.Y*zoomFactor),(int)(rect.Width*zoomFactor),(int)(rect.Height*zoomFactor));}// Convert mouse coordinates to actual image coordinatesprivatePointTransformPoint(Pointp){returnnewPoint((int)(p.X/zoomFactor),(int)(p.Y/zoomFactor));}privatevoidPictureBox_MouseWheel(objectsender,MouseEventArgse){if(Control.ModifierKeys==Keys.Control&&LoadedImage.Image!=null){floatoldZoomFactor=zoomFactor;if(e.Delta>0)zoomFactor*=1+zoomStep;elseif(e.Delta<0)zoomFactor/=1+zoomStep;// Prevent zooming out beyond the original image sizezoomFactor=Math.Max(1.0f,Math.Min(zoomFactor,5.0f));// Calculate zoom center relative to imagezoomCenter=e.Location;// Update transformation matrixtransformMatrix.Reset();transformMatrix.Translate(-zoomCenter.X,-zoomCenter.Y,MatrixOrder.Append);transformMatrix.Scale(zoomFactor,zoomFactor,MatrixOrder.Append);transformMatrix.Translate(zoomCenter.X,zoomCenter.Y,MatrixOrder.Append);LoadedImage.Invalidate();}}privatevoidPictureBox_MouseDown(objectsender,MouseEventArgse){if(LoadedImage.Image==null)return;PointimagePoint=TransformPoint(e.Location);boolclickedOnLabel=false;foreach(varlabelinlabels){resizeHandleType=GetResizeHandle(imagePoint,label.Rect);if(resizeHandleType!=ResizeHandleType.None){selectedLabel=label;isResizing=true;dragStart=imagePoint;clickedOnLabel=true;break;}if(label.Rect.Contains(imagePoint)){selectedLabel=label;isDragging=true;dragStart=imagePoint;clickedOnLabel=true;break;}}if(!clickedOnLabel){isDrawing=true;startPoint=imagePoint;currentRect=newRectangle(startPoint,Size.Empty);selectedLabel=null;LabelListBox.ClearSelected();}}privatevoidPictureBox_MouseMove(objectsender,MouseEventArgse){cursorPosition=TransformPoint(e.Location);LoadedImage.Invalidate();if(isDrawing){currentRect=newRectangle(Math.Min(startPoint.X,cursorPosition.X),Math.Min(startPoint.Y,cursorPosition.Y),Math.Abs(cursorPosition.X-startPoint.X),Math.Abs(cursorPosition.Y-startPoint.Y));return;}if(selectedLabel==null)return;if(isResizing){ResizeLabel(selectedLabel,resizeHandleType,TransformPoint(e.Location));}elseif(isDragging){intdx=cursorPosition.X-dragStart.X;intdy=cursorPosition.Y-dragStart.Y;selectedLabel.Rect=newRectangle(selectedLabel.Rect.X+dx,selectedLabel.Rect.Y+dy,selectedLabel.Rect.Width,selectedLabel.Rect.Height);dragStart=cursorPosition;}}privatevoidPictureBox_MouseUp(objectsender,MouseEventArgse){if(isDrawing){isDrawing=false;if(currentRect.Width>10&¤tRect.Height>10){varnewLabel=newLabelData{Rect=currentRect,Name=$"Label {labels.Count + 1}"};labels.Add(newLabel);LabelListBox.Items.Add(newLabel.Name);}}isDragging=false;isResizing=false;}privatevoidPictureBox_Paint(objectsender,PaintEventArgse){if(LoadedImage.Image==null)return;e.Graphics.Transform=transformMatrix;// Draw imagee.Graphics.DrawImage(LoadedImage.Image,newRectangle(0,0,LoadedImage.Image.Width,LoadedImage.Image.Height));// Draw labels at the correct scaleusingPenpen=new(Color.Red,2/zoomFactor);// Adjust pen thicknessforeach(varlabelinlabels){RectanglezoomedRect=TransformRectangle(label.Rect);e.Graphics.DrawRectangle(pen,zoomedRect);if(selectedLabel==label){DrawResizeHandles(e.Graphics,zoomedRect);}}// Draw current drawing rectangle correctly scaledif(isDrawing){RectanglezoomedRect=TransformRectangle(currentRect);e.Graphics.DrawRectangle(pen,zoomedRect);}DrawCrosshair(e.Graphics);}
Logs and Screenshots
Browser Console Logs:
Docker Container Logs:
[Include relevant Docker container logs, if applicable]
Screenshots/Screen Recordings (if applicable):
Additional Information
Like I said that is about it, just increased those two params, maybe they were a bit extreme but I'm not really sure.
Note
If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
Originally created by @Babyhamsta on GitHub (Jan 31, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/9168
# Bug Report
## Installation Method
Pip install (v0.5.7)
## Environment
- **Open WebUI Version:** 0.5.7
- **Ollama (if applicable):** 0.5.7
- **Operating System:** Windows 10
- **Browser (if applicable):** Ungoogled Chromium (https://github.com/ungoogled-software/ungoogled-chromium)
**Confirmation:**
- [x] I have read and followed all the instructions provided in the README.md.
- [x] I am on the latest version of both Open WebUI and Ollama.
- [x] I have included the browser console logs.
- [x] I have included the Docker container logs.
- [x] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.
## Expected Behavior:
Thinking tab should only be created once and should update multiple times with new data/information.
## Actual Behavior:
The thinking tab was created for each step I believe.
## Description
**Bug Summary:**
When asking R1 for some assistance with a bug I was having with C# code. I wanted a larger context length and potential response so I increased the 2 settings num_keep/num_predict. After doing so the AI/UI proceeded to bug out and create many many many thinking tabs. It ran for quite a long time and I didn't allow it finish it's response as it ran longer than 10 minutes.
## Reproduction Details
**Steps to Reproduce:**
Increase num_keep/num_predict:
Num_keep: 1002776
Num_predict: 20000
My exact prompt:
```c#
Can you help me fix my zooming functionality in C#? Currently it zooms in but the crosshair doesn't render correctly when zoomed in nor does the label match where we are drawing when zoomed in when we zoom back out. If we create a label before zooming in it doesn't stay in place where it should be which is part of the problem.
C# Code:
// Zoom
private float zoomFactor = 1.0f;
private const float zoomStep = 0.1f;
private Point zoomCenter = Point.Empty;
private Matrix transformMatrix = new Matrix();
private void ResizeLabel(LabelData label, ResizeHandleType handleType, Point mousePos)
{
int x = label.Rect.X;
int y = label.Rect.Y;
int width = label.Rect.Width;
int height = label.Rect.Height;
switch (handleType)
{
case ResizeHandleType.TopLeft:
width += x - mousePos.X;
height += y - mousePos.Y;
x = mousePos.X;
y = mousePos.Y;
break;
case ResizeHandleType.TopRight:
width = mousePos.X - x;
height += y - mousePos.Y;
y = mousePos.Y;
break;
case ResizeHandleType.BottomLeft:
width += x - mousePos.X;
x = mousePos.X;
height = mousePos.Y - y;
break;
case ResizeHandleType.BottomRight:
width = mousePos.X - x;
height = mousePos.Y - y;
break;
case ResizeHandleType.Left:
width += x - mousePos.X;
x = mousePos.X;
break;
case ResizeHandleType.Right:
width = mousePos.X - x;
break;
case ResizeHandleType.Top:
height += y - mousePos.Y;
y = mousePos.Y;
break;
case ResizeHandleType.Bottom:
height = mousePos.Y - y;
break;
}
label.Rect = new Rectangle(x, y, Math.Max(10, width), Math.Max(10, height));
}
private ResizeHandleType GetResizeHandle(Point mousePos, Rectangle rect)
{
int s = resizeHandleSize;
Rectangle[] handles =
{
new Rectangle(rect.Left - s, rect.Top - s, s 2, s 2), // Top Left
new Rectangle(rect.Right - s, rect.Top - s, s 2, s 2), // Top Right
new Rectangle(rect.Left - s, rect.Bottom - s, s 2, s 2),// Bottom Left
new Rectangle(rect.Right - s, rect.Bottom - s, s 2, s 2),// Bottom Right
new Rectangle(rect.Left - s, rect.Top + rect.Height / 2 - s, s 2, s 2), // Left
new Rectangle(rect.Right - s, rect.Top + rect.Height / 2 - s, s 2, s 2), // Right
new Rectangle(rect.Left + rect.Width / 2 - s, rect.Top - s, s 2, s 2), // Top
new Rectangle(rect.Left + rect.Width / 2 - s, rect.Bottom - s, s 2, s 2) // Bottom
};
ResizeHandleType[] types = { ResizeHandleType.TopLeft, ResizeHandleType.TopRight,
ResizeHandleType.BottomLeft, ResizeHandleType.BottomRight,
ResizeHandleType.Left, ResizeHandleType.Right,
ResizeHandleType.Top, ResizeHandleType.Bottom };
for (int i = 0; i < handles.Length; i++)
{
if (handles[i].Contains(mousePos))
return types[i];
}
return ResizeHandleType.None;
}
private void DrawResizeHandles(Graphics g, Rectangle rect)
{
int s = resizeHandleSize;
Rectangle[] handles =
{
new Rectangle(rect.Left - s, rect.Top - s, s _2, s_ 2), // Top Left
new Rectangle(rect.Right - s, rect.Top - s, s _2, s_ 2), // Top Right
new Rectangle(rect.Left - s, rect.Bottom - s, s _2, s_ 2),// Bottom Left
new Rectangle(rect.Right - s, rect.Bottom - s, s _2, s_ 2),// Bottom Right
new Rectangle(rect.Left - s, rect.Top + rect.Height / 2 - s, s _2, s_ 2), // Left
new Rectangle(rect.Right - s, rect.Top + rect.Height / 2 - s, s _2, s_ 2), // Right
new Rectangle(rect.Left + rect.Width / 2 - s, rect.Top - s, s _2, s_ 2), // Top
new Rectangle(rect.Left + rect.Width / 2 - s, rect.Bottom - s, s _2, s_ 2) // Bottom
};
foreach (var handle in handles)
{
g.FillRectangle(Brushes.Black, handle);
}
}
private void DrawCrosshair(Graphics g)
{
if (cursorPosition == Point.Empty) return;
using Pen crosshairPen = new(crosshairColor, crosshairSize);
// Draw horizontal line
g.DrawLine(crosshairPen, new Point(0, cursorPosition.Y), new Point(LoadedImage.Width, cursorPosition.Y));
// Draw vertical line
g.DrawLine(crosshairPen, new Point(cursorPosition.X, 0), new Point(cursorPosition.X, LoadedImage.Height));
}
// Adjusts a rectangle based on the current zoom transformation
private Rectangle TransformRectangle(Rectangle rect)
{
return new Rectangle(
(int)(rect.X * zoomFactor),
(int)(rect.Y * zoomFactor),
(int)(rect.Width * zoomFactor),
(int)(rect.Height * zoomFactor)
);
}
// Convert mouse coordinates to actual image coordinates
private Point TransformPoint(Point p)
{
return new Point((int)(p.X / zoomFactor), (int)(p.Y / zoomFactor));
}
private void PictureBox_MouseWheel(object sender, MouseEventArgs e)
{
if (Control.ModifierKeys == Keys.Control && LoadedImage.Image != null)
{
float oldZoomFactor = zoomFactor;
if (e.Delta > 0)
zoomFactor *= 1 + zoomStep;
else if (e.Delta < 0)
zoomFactor /= 1 + zoomStep;
// Prevent zooming out beyond the original image size
zoomFactor = Math.Max(1.0f, Math.Min(zoomFactor, 5.0f));
// Calculate zoom center relative to image
zoomCenter = e.Location;
// Update transformation matrix
transformMatrix.Reset();
transformMatrix.Translate(-zoomCenter.X, -zoomCenter.Y, MatrixOrder.Append);
transformMatrix.Scale(zoomFactor, zoomFactor, MatrixOrder.Append);
transformMatrix.Translate(zoomCenter.X, zoomCenter.Y, MatrixOrder.Append);
LoadedImage.Invalidate();
}
}
private void PictureBox_MouseDown(object sender, MouseEventArgs e)
{
if (LoadedImage.Image == null) return;
Point imagePoint = TransformPoint(e.Location);
bool clickedOnLabel = false;
foreach (var label in labels)
{
resizeHandleType = GetResizeHandle(imagePoint, label.Rect);
if (resizeHandleType != ResizeHandleType.None)
{
selectedLabel = label;
isResizing = true;
dragStart = imagePoint;
clickedOnLabel = true;
break;
}
if (label.Rect.Contains(imagePoint))
{
selectedLabel = label;
isDragging = true;
dragStart = imagePoint;
clickedOnLabel = true;
break;
}
}
if (!clickedOnLabel)
{
isDrawing = true;
startPoint = imagePoint;
currentRect = new Rectangle(startPoint, Size.Empty);
selectedLabel = null;
LabelListBox.ClearSelected();
}
}
private void PictureBox_MouseMove(object sender, MouseEventArgs e)
{
cursorPosition = TransformPoint(e.Location);
LoadedImage.Invalidate();
if (isDrawing)
{
currentRect = new Rectangle(
Math.Min(startPoint.X, cursorPosition.X),
Math.Min(startPoint.Y, cursorPosition.Y),
Math.Abs(cursorPosition.X - startPoint.X),
Math.Abs(cursorPosition.Y - startPoint.Y)
);
return;
}
if (selectedLabel == null) return;
if (isResizing)
{
ResizeLabel(selectedLabel, resizeHandleType, TransformPoint(e.Location));
}
else if (isDragging)
{
int dx = cursorPosition.X - dragStart.X;
int dy = cursorPosition.Y - dragStart.Y;
selectedLabel.Rect = new Rectangle(selectedLabel.Rect.X + dx, selectedLabel.Rect.Y + dy,
selectedLabel.Rect.Width, selectedLabel.Rect.Height);
dragStart = cursorPosition;
}
}
private void PictureBox_MouseUp(object sender, MouseEventArgs e)
{
if (isDrawing)
{
isDrawing = false;
if (currentRect.Width > 10 && currentRect.Height > 10)
{
var newLabel = new LabelData { Rect = currentRect, Name = $"Label {labels.Count + 1}" };
labels.Add(newLabel);
LabelListBox.Items.Add(newLabel.Name);
}
}
isDragging = false;
isResizing = false;
}
private void PictureBox_Paint(object sender, PaintEventArgs e)
{
if (LoadedImage.Image == null) return;
e.Graphics.Transform = transformMatrix;
// Draw image
e.Graphics.DrawImage(LoadedImage.Image, new Rectangle(0, 0, LoadedImage.Image.Width, LoadedImage.Image.Height));
// Draw labels at the correct scale
using Pen pen = new(Color.Red, 2 / zoomFactor); // Adjust pen thickness
foreach (var label in labels)
{
Rectangle zoomedRect = TransformRectangle(label.Rect);
e.Graphics.DrawRectangle(pen, zoomedRect);
if (selectedLabel == label)
{
DrawResizeHandles(e.Graphics, zoomedRect);
}
}
// Draw current drawing rectangle correctly scaled
if (isDrawing)
{
Rectangle zoomedRect = TransformRectangle(currentRect);
e.Graphics.DrawRectangle(pen, zoomedRect);
}
DrawCrosshair(e.Graphics);
}
```
## Logs and Screenshots
**Browser Console Logs:**



**Docker Container Logs:**
[Include relevant Docker container logs, if applicable]
**Screenshots/Screen Recordings (if applicable):**


## Additional Information
Like I said that is about it, just increased those two params, maybe they were a bit extreme but I'm not really sure.
## Note
If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
Actually I see that I was increasing the wrong ones, should of done Context and num_predict vs keep. But I still wonder why it recreates the think each time.
<!-- gh-comment-id:2627642527 -->
@Babyhamsta commented on GitHub (Jan 31, 2025):
Actually I see that I was increasing the wrong ones, should of done Context and num_predict vs keep. But I still wonder why it recreates the think each time.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @Babyhamsta on GitHub (Jan 31, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/9168
Bug Report
Installation Method
Pip install (v0.5.7)
Environment
Open WebUI Version: 0.5.7
Ollama (if applicable): 0.5.7
Operating System: Windows 10
Browser (if applicable): Ungoogled Chromium (https://github.com/ungoogled-software/ungoogled-chromium)
Confirmation:
Expected Behavior:
Thinking tab should only be created once and should update multiple times with new data/information.
Actual Behavior:
The thinking tab was created for each step I believe.
Description
Bug Summary:
When asking R1 for some assistance with a bug I was having with C# code. I wanted a larger context length and potential response so I increased the 2 settings num_keep/num_predict. After doing so the AI/UI proceeded to bug out and create many many many thinking tabs. It ran for quite a long time and I didn't allow it finish it's response as it ran longer than 10 minutes.
Reproduction Details
Steps to Reproduce:
Increase num_keep/num_predict:
Num_keep: 1002776
Num_predict: 20000
My exact prompt:
Logs and Screenshots
Browser Console Logs:
Docker Container Logs:
[Include relevant Docker container logs, if applicable]
Screenshots/Screen Recordings (if applicable):
Additional Information
Like I said that is about it, just increased those two params, maybe they were a bit extreme but I'm not really sure.
Note
If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
@Babyhamsta commented on GitHub (Jan 31, 2025):
Actually I see that I was increasing the wrong ones, should of done Context and num_predict vs keep. But I still wonder why it recreates the think each time.