Skip to content

🎨 Palette: Add retry feedback to CLI commands#286

Merged
bmesuere merged 1 commit intomainfrom
palette-retry-feedback-12170354350089645752
Jan 16, 2026
Merged

🎨 Palette: Add retry feedback to CLI commands#286
bmesuere merged 1 commit intomainfrom
palette-retry-feedback-12170354350089645752

Conversation

@google-labs-jules
Copy link
Contributor

Improved the CLI user experience by adding visible feedback when API requests fail and are being retried. Previously, the CLI would hang silently for up to several seconds during retries. Now, it writes a message to stderr indicating the error and the time until the next retry attempt, ensuring users know the process is still active. This change affects all subcommands inheriting from UnipeptSubcommand.


PR created automatically by Jules for task 12170354350089645752 started by @bmesuere

@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@bmesuere bmesuere marked this pull request as ready for review January 16, 2026 10:53
Copilot AI review requested due to automatic review settings January 16, 2026 10:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves CLI user experience by adding visible retry feedback for API requests. Previously, when API requests failed and were being retried, the CLI would hang silently. Now it writes informative messages to stderr showing the error and countdown to the next retry attempt.

Changes:

  • Modified fetchWithRetry to output retry feedback messages to stderr
  • Changed delay calculation from Math.random() to Math.ceil(Math.random()) for cleaner display

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// retry with delay
// console.error("retrying");
const delay = 5000 * Math.random();
const delay = Math.ceil(5000 * Math.random());
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The delay calculation using Math.ceil(5000 * Math.random()) produces delays from 1-5000ms rather than the documented 0-5 seconds. Consider using Math.floor(5000 * Math.random()) to maintain the original 0-5000ms range, or update the JSDoc comment on line 219 to reflect the new 1-5000ms range.

Suggested change
const delay = Math.ceil(5000 * Math.random());
const delay = Math.floor(5000 * Math.random());

Copilot uses AI. Check for mistakes.
// console.error("retrying");
const delay = 5000 * Math.random();
const delay = Math.ceil(5000 * Math.random());
process.stderr.write(`> Request failed: ${error}. Retrying in ${(delay / 1000).toFixed(1)}s...\n`);
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The new stderr output for retry feedback should be covered by tests. Consider adding test cases in tests/commands/unipept/retry_logic.test.ts to verify that the retry message is written to stderr with the correct format when retries occur.

Copilot uses AI. Check for mistakes.
@bmesuere bmesuere merged commit e1596e8 into main Jan 16, 2026
9 checks passed
@bmesuere bmesuere deleted the palette-retry-feedback-12170354350089645752 branch January 16, 2026 11:17
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