Skip to content

fix(examples): improve gemini.py CLI experience#103

Open
whhe wants to merge 1 commit into
agentclientprotocol:mainfrom
whhe:improve/gemini-example-ux
Open

fix(examples): improve gemini.py CLI experience#103
whhe wants to merge 1 commit into
agentclientprotocol:mainfrom
whhe:improve/gemini-example-ux

Conversation

@whhe
Copy link
Copy Markdown

@whhe whhe commented May 21, 2026

Summary

Improve the Gemini example's compatibility and robustness with a few small fixes.

Changes

  • Support --acp flag (default) with --experimental-acp fallback via CLI arg, and update docs/quickstart.md accordingly
  • Suppress Gemini CLI stderr output in non-debug mode to reduce terminal noise
  • Drain subprocess stdin before terminating in _shutdown() for cleaner process teardown
  • Catch KeyboardInterrupt in main() to exit silently instead of printing a traceback

Motivation

The Gemini CLI has graduated --experimental-acp to --acp, but older installations still need the old flag. The other fixes address minor UX papercuts: noisy stderr output, unclean shutdown on Ctrl-C, and a possible broken-pipe on teardown.

- Support --acp flag with --experimental-acp fallback for older versions
- Suppress Gemini CLI stderr noise in non-debug mode
- Drain stdin before terminating subprocess for cleaner shutdown
- Catch KeyboardInterrupt in main() to avoid noisy traceback

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
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.

1 participant