Skip to content

Fix output in agent tool use#5532

Open
paulbalandan wants to merge 1 commit intophpstan:2.1.xfrom
paulbalandan:agent-no-overwrite
Open

Fix output in agent tool use#5532
paulbalandan wants to merge 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 on lines +53 to +55
self::assertFalse($this->getProgressBarBoolProperty($progressBar, 'overwrite'));
self::assertSame(15.0, $this->getProgressBarFloatProperty($progressBar, 'minSecondsBetweenRedraws'));
self::assertSame(30.0, $this->getProgressBarFloatProperty($progressBar, 'maxSecondsBetweenRedraws'));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its fine to only assert on the rendered output. no need to complicate this test with this non-public implementation details

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Limited the test to asserting the rendered output.

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.

3 participants