Skip to content

Support echo "hello" | docker agent | cat#2197

Merged
dgageot merged 2 commits intodocker:mainfrom
dgageot:piping
Mar 20, 2026
Merged

Support echo "hello" | docker agent | cat#2197
dgageot merged 2 commits intodocker:mainfrom
dgageot:piping

Conversation

@dgageot
Copy link
Member

@dgageot dgageot commented Mar 20, 2026

No description provided.

Signed-off-by: David Gageot <david.gageot@docker.com>
@dgageot dgageot requested a review from a team as a code owner March 20, 2026 17:34
Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

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

Assessment: 🟢 APPROVE

This PR successfully implements support for piping input/output through docker-agent. The changes are well-structured:

  • TTY Detection: Properly detects TTY status at Printer creation time
  • Agent Name Header: Correctly suppressed when output is not a TTY (e.g., piped to cat)
  • Stdin Handling: New case handles piped input when stdin is not a terminal
  • Test Updates: All tests updated to reflect the new behavior

No bugs found in the changed code. The implementation correctly handles the use case echo "hello" | docker agent | cat.

Skip printing the '--- Agent: root ---' header when output is piped,
so that 'echo hello | docker agent | cat' produces clean output.

Assisted-By: docker-agent
@dgageot dgageot merged commit 91695ab into docker:main Mar 20, 2026
4 checks passed
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.

2 participants