Skip to content

Conversation

@pypingou
Copy link

  • Make the client exit with an error code 1 when it fails at the task asked (useful when calling it from a CI job)
  • Implement a retry with --retry, --timeout and --retry-interval when requesting a new session (in case the pool is very busy)
  • Make the client answer to -h in addition to --help

pypingou and others added 3 commits October 20, 2025 18:19
- Add error checking and proper exit codes to client commands
- Ensures API errors are displayed to stderr and exit with code 1
- Improves user experience by providing clear error feedback
- Affects: list_sessions, show_session, request_session, retire_session, list_pools, show_pool

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Add --retry flag to enable retry behavior on session request failures
- Add --timeout option for total retry duration in minutes (default: 5)
- Add --retry-interval option for delay between attempts (default: 45 seconds)
- Implement fixed-interval retry logic suitable for long timeouts (20-30 min)
- Show progress updates every 5 attempts and success confirmation
- Maintain backward compatibility - no retry without --retry flag
- Add required imports: time and random modules

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Configure context_settings to support both -h and --help for all command groups
- Affects main duffy command, config, migration, admin, and client subgroups
- Improves CLI usability with standard Unix convention for help flags
- Maintains backward compatibility with existing --help usage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@pypingou pypingou force-pushed the add-cli-error-handling branch from 5a1bd3f to 0dad407 Compare November 22, 2025 10:46
- Add tests for -h short option support across all CLI command groups
- Add error handling tests for all client commands verifying stderr output and exit codes
- Add comprehensive retry functionality tests including success, timeout, and progress reporting scenarios
- Update existing client command tests to include error case coverage
- Ensure all tests follow consistent mocking patterns with proper sys.exit and click.echo verification

Tests cover changes from commits:
- b747292: Error handling with proper exit codes
- 10e800e: Retry functionality for request-session command
- ad9dbb5: -h short option support for help

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@pypingou pypingou force-pushed the add-cli-error-handling branch from 0dad407 to f09627c Compare November 22, 2025 10:46
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