Skip to content

Fix STDIN consumption in alias groups for eval-file#86

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/fix-stdin-input-alias-group
Draft

Fix STDIN consumption in alias groups for eval-file#86
Copilot wants to merge 5 commits intomainfrom
copilot/fix-stdin-input-alias-group

Conversation

Copy link
Contributor

Copilot AI commented Feb 15, 2026

Fix STDIN input with alias groups for eval-file command

  • Add static cache property to store STDIN contents
  • Modify execute_eval method to cache STDIN on first read
  • Use persistent temp file keyed by parent PID for cross-process caching
  • Reuse cached STDIN for subsequent reads in alias groups
  • Add automatic cleanup of stale cache files (older than 1 hour)
  • Improve Windows compatibility with environment variable fallback
  • Pass all code quality checks (lint, phpcs, phpstan)
  • Fix test to verify STDIN executes on both sites in alias group
  • Address test failure feedback
Original prompt

This section details on the original issue you should resolve

<issue_title>Input from STDIN does not work with an alias group</issue_title>
<issue_description>cat cleanup_stuff.php | wp @site_a eval-file - works.
But it does not work if used with a alias group.
It only triggers on the first entry of the alias group.
eval-file alias

</issue_description>

Comments on the Issue (you are @copilot in this section)

@janw-me I also took alook at the output when adding the `--debug` flag. I'm willing to look into it but am uncertain where to start. @janw-me PS a dirty hack workaround I found out is misusing the regular `eval` command:

wp @blueprint eval "$(tail -n +2 cleanup.php )"</comment_new>
<comment_new>@schlessera
Oh, I assume STDIN is being read per site for the group, so after the first run, the empty STDIN is being read.

Not sure how we should go about for this, I'll have to do a bit of exploration here.</comment_new>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits February 15, 2026 17:18
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix STDIN input handling for alias group Fix STDIN consumption in alias groups for eval-file Feb 15, 2026
Copilot AI requested a review from swissspidy February 15, 2026 17:29
@swissspidy

This comment was marked as resolved.

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>

This comment was marked as resolved.

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.

Input from STDIN does not work with an alias group

2 participants