Skip to content

fix: always pass prompt via stdin to satisfy cagent exec's required prompt arg#46

Merged
derekmisler merged 1 commit intodocker:mainfrom
derekmisler:always-pass-prompt-via-stdin
Feb 17, 2026
Merged

fix: always pass prompt via stdin to satisfy cagent exec's required prompt arg#46
derekmisler merged 1 commit intodocker:mainfrom
derekmisler:always-pass-prompt-via-stdin

Conversation

@derekmisler
Copy link
Contributor

@derekmisler derekmisler commented Feb 17, 2026

Summary

Fixes a bug where cagent exec would fail when no prompt was provided, since the CLI requires a prompt argument. The action now always passes - (stdin) as the prompt argument, sending an empty string when no prompt is specified.

Changes

  • action.yml: Unconditionally adds - to arguments and always pipes prompt via stdin (empty string if not provided), eliminating conditional branching for prompt handling
  • review-pr/README.md: Removed redundant YAML example from documentation

Breaking Changes

None

How to Test

  • Run the action without a prompt input and verify cagent exec executes successfully with an empty prompt
  • Run the action with a prompt input and verify it still works as before

…rompt arg

Signed-off-by: Derek Misler <derek.misler@docker.com>
@derekmisler derekmisler self-assigned this Feb 17, 2026
@derekmisler derekmisler marked this pull request as ready for review February 17, 2026 16:00
@derekmisler derekmisler requested a review from a team as a code owner February 17, 2026 16:00
@derekmisler
Copy link
Contributor Author

/describe

@docker-agent
Copy link

docker-agent bot commented Feb 17, 2026

✅ PR description has been generated and updated!

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.

Review Summary

APPROVED - No new bugs introduced

The refactoring successfully achieves its goal of always passing a prompt via stdin to satisfy cagent exec's required prompt argument. The changes consolidate the conditional logic into a simpler, unconditional flow without introducing new functional issues.

Changes Reviewed

  • ✅ Always adds - to ARGS to enable stdin input (line 498)
  • ✅ Unconditionally pipes prompt (or empty string) to stdin
  • ✅ Simplified branching logic while maintaining functional behavior
  • ✅ README.md documentation cleanup

Optional Future Enhancement

While not blocking this PR, I noticed pre-existing exit code handling that could be improved in a future change:

  • Line 512: EXIT_CODE=$? captures tee's exit code instead of the timeout command's exit code
  • Line 518: EXIT_CODE=${PIPESTATUS[0]} captures printf's exit code instead of cagent's exit code

These issues existed before your changes and don't need to be addressed in this PR. The consolidation you've done is correct. Consider ${PIPESTATUS[1]} for proper exit code capture in both cases if you want to tackle this separately.


Verdict: The changed code works correctly for its intended purpose. Ship it! 🚢

@derekmisler derekmisler merged commit d53201d into docker:main Feb 17, 2026
28 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