Skip to content

Fix output in agent tool use#5532

Merged
ondrejmirtes merged 1 commit intophpstan:2.1.xfrom
paulbalandan:agent-no-overwrite
Apr 27, 2026
Merged

Fix output in agent tool use#5532
ondrejmirtes merged 1 commit intophpstan:2.1.xfrom
paulbalandan:agent-no-overwrite

Conversation

@paulbalandan
Copy link
Copy Markdown
Contributor

In agent tool uses, I just noticed that output tries to overwrite the progress bar but it's not possible in the terminal used by the agent.

Note: Using configuration file /Users/paul/Workspace/CodeIgniter4/phpstan.neon.
   0/946 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0% < 1 sec�[1G�[2K  20/946 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   2% 2 secs�[1G�[2K  40/946 [▓░░░░░░░░░░░░░░░░░░░░░░░░░░░]   4% 3 secs�[1G�[2K  80/946 [▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░]   8% 5 secs�[1G�[2K 140/946 [▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░]  14% 6 secs�[1G�[2K 200/946 [▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░]  21% 7 secs�[1G�[2K 260/946 [▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░]  27% 8 secs�[1G�[2K 300/946 [▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░]  31% 9 secs�[1G�[2K 340/946 [▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░]  35% 10 secs�[1G�[2K 380/946 [▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░]  40% 10 secs�[1G�[2K 420/946 [▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░]  44% 11 secs�[1G�[2K 480/946 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░]  50% 11 secs�[1G�[2K 500/946 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░]  52% 12 secs�[1G�[2K 560/946 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░]  59% 13 secs�[1G�[2K 620/946 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░]  65% 14 secs�[1G�[2K 640/946 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░]  67% 15 secs�[1G�[2K 680/946 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░]  71% 17 secs�[1G�[2K 720/946 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░]  76% 17 secs�[1G�[2K 760/946 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░]  80% 18 secs�[1G�[2K 800/946 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░]  84% 20 secs�[1G�[2K 840/946 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░]  88% 21 secs�[1G�[2K 860/946 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░]  90% 21 secs�[1G�[2K 946/946 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% 21 secs


�[30;42m                                                                                �[39;49m
�[30;42m [OK] No errors                                                                 �[39;49m
�[30;42m                                                                                �[39;49m

Elapsed time: 23.12 seconds
Used memory: 2.58 GB

This change is purely cosmetic for agents just to be consistent with CI environments.

@phpstan-bot
Copy link
Copy Markdown
Collaborator

You've opened the pull request against the latest branch 2.2.x. PHPStan 2.2 is not going to be released for months. If your code is relevant on 2.1.x and you want it to be released sooner, please rebase your pull request and change its target to 2.1.x.

@paulbalandan paulbalandan changed the base branch from 2.2.x to 2.1.x April 25, 2026 12:26
@paulbalandan paulbalandan force-pushed the agent-no-overwrite branch 5 times, most recently from c18d0fa to cf9ef99 Compare April 25, 2026 17:18
Comment thread tests/PHPStan/Command/ErrorsConsoleStyleTest.php Outdated
@staabm staabm force-pushed the agent-no-overwrite branch from ce2325f to d2491b0 Compare April 27, 2026 05:13
Comment thread tests/PHPStan/Command/ErrorsConsoleStyleTest.php
@staabm staabm requested a review from VincentLanglet April 27, 2026 05:27
@ondrejmirtes ondrejmirtes merged commit 92c2930 into phpstan:2.1.x Apr 27, 2026
660 of 662 checks passed
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you.

@staabm
Copy link
Copy Markdown
Contributor

staabm commented Apr 27, 2026

@paulbalandan seeing �[30;42m in the 3 status lines below the progress bar, makes me think whether it makes sense to auto-run PHPStan with --no-ansi from within agents (or treat it the same thing).

wdyt?

@paulbalandan
Copy link
Copy Markdown
Contributor Author

@staabm yeah it makes sense. anyway, the terminal the agents are using has no TTY support so it won't render the ANSI codes. In my example, it has those codes because the agent runs the composer script which enforces --ansi

@paulbalandan paulbalandan deleted the agent-no-overwrite branch April 27, 2026 09:30
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.

4 participants