Skip to content

Conversation

@JohnAZoidberg
Copy link
Member

v0 only supports 8 bit command IDs.

I ran into an issue where truncation and then misreporting happened. I asked claude to fix it and it wanted to just try the command to see if it fails. After I said that's not a good idea, we need to figure out what's wrong, it found this issue.

v0 only supports 8 bit command IDs.

I ran into an issue where truncation and then misreporting happened.
I asked claude to fix it and it wanted to just try the command to see
if it fails. After I said that's not a good idea, we need to figure out
what's wrong, it found this issue.

Signed-off-by: Daniel Schaefer <dhs@frame.work>
@JohnAZoidberg
Copy link
Member Author

Rewrote it again to make the code obviously safe without truncating typecasts.

@JohnAZoidberg JohnAZoidberg requested a review from Copilot January 17, 2026 15:28
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 fixes a bug in the cmd_version_supported function where command IDs greater than 255 (0xFF) were being incorrectly truncated when falling back to the v0 API, which only supports 8-bit command IDs. The fix ensures that commands with IDs > 255 return false instead of being silently truncated and potentially misreported.

Changes:

  • Updated the function signature to accept u32 instead of u16 for the command parameter
  • Added proper validation to only fall back to v0 API when the command ID fits in 8 bits
  • Commands with IDs > 255 now correctly return false instead of being truncated

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

@JohnAZoidberg JohnAZoidberg merged commit 6fa32d5 into main Jan 17, 2026
7 checks passed
@JohnAZoidberg JohnAZoidberg deleted the fix-getcmdversion branch January 17, 2026 17:22
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