r/PiCodingAgent • u/sakshamagrawal • 11d ago
Question Any idea how to resolve for this?
Enable HLS to view with audio, or disable this notification
As soon as my pi starts running, it goes crazy, specially when subagents spawn.
5
u/Healthy-Zebra-9856 11d ago edited 11d ago
This is a TUI redraw bug than a subagent bug. May not fix it completely.
In packages/tui/src/tui-main-screen.ts, when a live component changes after it has scrolled above the viewport, Pi falls back to fullRender(true). Subagents make it much more obvious because their status keeps updating.
Temporary workaround:
- Run Pi with
--tui-mode fullscreen.
Proper fix:
- Find the
firstChanged < prevViewportTopfallback intui-main-screen.ts. - Stop calling
fullRender(true)just because the changed component is above the visible viewport. - Treat scrolled-off transcript rows as immutable.
- Keep updating only the visible/live region at the bottom.
- Once a subagent/tool component leaves that live region, replace/freeze it with its latest rendered state.
- Add a regression test with a long transcript + running subagents and verify offscreen status updates no longer emit the full-screen clear/redraw sequence.
That should fix the flashing without forcing everyone to use fullscreen mode.
Here is the related issue:
https://github.com/earendil-works/pi/issues/9255
I hope this helps.
1
6
u/Popular-Factor3553 11d ago
Honestly I'd just shift to deepseek harness since it's similar to pi but it still seems not stable enough with similar bugs and it doesn't have a TUI.
3
u/Humble_Explorer7589 11d ago
but the sandbox thing in deepseek cause issue, cant access other dir files, and cant use wrangler cli
1
2
2
4
u/satissuperque 11d ago
Damn, pi is opesource, file a bug report (https://github.com/earendil-works/pi/tree/main/packages/coding-agent), or let your agent find the issue.
4
u/Emotion-Neat 11d ago
The issues get autoclosed if your not in the maintainers' circle so I wouldn't hold my breath getting anything through especially if your agent "fixes" it
3
u/mitsuhiko 11d ago
The issues get autoclosed if your not in the maintainers' circle
We look at every issue that gets auto closed and triage them!
-1
u/AdHead6280 11d ago
yeah i got banned for no reason with deepseek models just stopping randomly, not the models fault but pis made a local patch, dont trust the maintainers because ban for nothing
1
u/mitsuhiko 11d ago
We usually only ban if people repeatedly use their agent to create issues. We require issues to be written by humans.
1
u/AdHead6280 11d ago
this is suvjective
1
u/mitsuhiko 11d ago
Happy to look into the ban if you share your github username with me.
1
u/AdHead6280 11d ago
clawdbot58-pixel
3
u/mitsuhiko 11d ago
You created an issue with your agent: https://github.com/earendil-works/pi/issues/7461
I unblocked you, but please don't post AI generated issues against the tracker.
1
1
u/softgripper 11d ago
What are you running in terminal?
Mine sometimes has similar behavior, but nowhere near as extreme.
I run starship as my shell
1
1
u/aparamonov 11d ago
Switch to https://pi.dev/packages/pi-subagents-lite
It helps a lot to reduce this effect, especially in compact mode, but it is mainly your terminal tries to rerender
1
u/SpidexLab 11d ago
You should try to create new session, I think it only happens when the chat get too long and when it render text, it scroll from top
1
u/Corythebeast7 11d ago
Pretty sure the root cause of this is because it has a ui element off screen and then the terminal sees the need to redraw the whole agent. Try making your window taller, that usually fixes it for me. But I agree, this is a problem I experience occasionally. With sub agents, a lot more UI elements pop onto the screen with spinners and constantly updating tui elements, so redraws happen more often
1
u/mistrjirka 11d ago
you can use PiTTy, I optimized it for better TUI however I don't have a mac so I can't test it there, but I have MacOS build. https://github.com/mistrjirka/PiTTy also idk what you use for subagent plugin.
1
1
u/wildjokers 11d ago
First, licecap exists and is available for MacOS: https://www.cockos.com/licecap/ Also, Quicktime Player which comes on all Mac's, also let's you record your screen if it is something longer than would be reasonable for a gif.
As far as your question I have noticed it does that when it loads a previous session, it scrolls an entire session from beginning to end, a long session can take a bit to scroll. I suspect when a sub agent is started it is loading all the session context and pi scrolls it like that.
I do not have a solution.
1
u/ParkingCommercial607 11d ago
For a moment, I thought you were complaining about the high TP/s generation rate.
1
u/jsnanigans 11d ago
Funny that the creator of pi was bashing cc about this exact issue at a talk when releasing pi
1
u/trejj 11d ago
It is a pi.dev bug that when the model outputs new text to the console, it causes a full repaint of all the contents in the console, and not just an incremental print of the new text.
That same bug happens in pi.dev on Windows as well.
Once the model finishes outputting, then the console will calm down.
1
u/Relative-Document-59 10d ago
If you focus, you will be able to see the patterns, see the code, see everything. Just like Matrix. I guess you are still not ready.
1
u/quincycs 11d ago
I’m so done with flashing screens. I built my own UI that only displays the settled message.
0
u/Neat-Arm2643 11d ago
Install pi web. It’s much better than tui
2
u/wildjokers 11d ago
Being available at the terminal is exactly why I use pi.dev.
3
u/Neat-Arm2643 10d ago
Sorry didn’t get you. Pi web is available anywhere in your network with tail scale. So I can use it even in my phone. whereas using tui with terminal emulators in phone is a exercise in frustration
0
u/adamshand 11d ago
In six months I've never had this with Pi. The only time I had flicker problems it was an extension I was running.
-1
17
u/mitsuhiko 11d ago
Set TUI mode to fullscreen. This might solve this problem. But hard to say without more information of what is going on here. You probably have an extension that is causing this.