Skip to content

Conversation

samuelselleck
Copy link
Contributor

Changes the quote failure message from this:

"No quote found for the desired order. Try with a different start date, duration, or price.

To this:

No availability for this time period and quantity.

Check current availability: https://sfcompute.com/dashboard/zones (2 min delay)
Try a different start time: sf buy -s +3h
Or adjust quantity: sf buy -n 8

@samuelselleck samuelselleck self-assigned this Sep 18, 2025
Copy link

semanticdiff-com bot commented Sep 18, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  deno.lock Unsupported file format
  src/lib/buy/index.tsx  0% smaller

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR enhances the user experience when quote requests fail in the CLI's buy functionality by replacing a generic error message with a more helpful, contextual error message. The change is made within the QuoteAndBuy React component in src/lib/buy/index.tsx.

The original error message "No quote found for the desired order. Try with a different start date, duration, or price." has been replaced with a dynamic message that provides specific, actionable guidance based on the user's current parameters. The new implementation:

  1. Provides contextual suggestions: Only suggests start time changes if the user didn't explicitly set a start time (defaults to "NOW"), and only suggests quantity reduction if they requested more than 8 GPUs
  2. Includes a clickable hyperlink: Uses ANSI OSC 8 escape sequences to create a terminal hyperlink to https://sfcompute.com/dashboard/zones for checking current availability
  3. Offers executable commands: Provides copy-pasteable CLI commands like sf buy -s +3h and sf buy -n 8 that users can immediately try
  4. Maintains error flow: Still calls logAndQuit() to terminate execution, preserving the existing error handling behavior

This change fits within the broader CLI architecture by improving the user experience without altering the core quote failure handling logic. The QuoteAndBuy component continues to manage the quote retrieval process and UI state, but now provides more meaningful feedback when quotes cannot be obtained.

Confidence score: 4/5

  • This PR is safe to merge with minimal risk as it only changes error messaging without affecting core functionality
  • Score reflects well-structured conditional logic and thoughtful UX improvements, though terminal hyperlink support may vary
  • Pay close attention to the ANSI escape sequence formatting in the error message construction

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

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