Fix ambient serde bug: handle string or u32 for Claude tool parameters#173
Open
zanni098 wants to merge 2 commits into
Open
Fix ambient serde bug: handle string or u32 for Claude tool parameters#173zanni098 wants to merge 2 commits into
zanni098 wants to merge 2 commits into
Conversation
This guide provides Windows-specific setup instructions and troubleshooting for jcode users on Windows 10/11. - Installation details (PowerShell installer, manual install) - Windows-specific configuration paths - CLI login flags (addressing issue 1jehuang#82) - Terminal compatibility recommendations - Known Windows issues (1jehuang#82, 1jehuang#118, 1jehuang#140) with workarounds - Troubleshooting section for common problems - How to get help and file issues
Claude's tool calling sends parameters as strings (e.g., {"compactions": "0"})
but the struct fields use u32, causing deserialization to fail with:
"invalid type: string \"0\", expected u32"
This fix adds custom deserializers to accept both string and u32 types:
- deserialize_string_or_u32: for required u32 fields
- deserialize_string_or_option_u32: for Option<u32> fields
Applied to:
- EndCycleInput: memories_modified, compactions
- NextScheduleInput: wake_in_minutes
- ScheduleInput: wake_in_minutes
- ScheduleToolInput: wake_in_minutes
Fixes 1jehuang#106
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #106
Claude's tool calling sends parameters as strings (e.g., {"compactions": "0"})
but the struct fields use u32, causing deserialization to fail with:
"invalid type: string "0", expected u32"
This fix adds custom deserializers to accept both string and u32 types:
Applied to:
Impact: Every ambient cycle was failing with this error, preventing ambient mode from working at all.
Need help on this PR? Tag
@codesmithwith what you need.