fix(auth): support string interval in OpenAI device-code flow#56
Merged
lxowalle merged 1 commit intosipeed:mainfrom Feb 12, 2026
Merged
Conversation
planned-date: 2026-02-12 why: Device-code login was failing because the interval field can arrive as a quoted number, which breaks strict integer decoding and blocks login in shell-only environments. what: Added flexible interval parsing for numeric or quoted values, wired LoginDeviceCode to the parser, printed the browser auth URL before waiting, and added parser tests for numeric, quoted, and invalid interval payloads. verification: c:\projects\toolchains\go\bin\go.exe test ./pkg/auth -run Test(ParseDeviceCodeResponse|BuildAuthorizeURL)
c39d709 to
a7bbda1
Compare
Collaborator
|
Thanks for the pr |
Contributor
|
Thanks for your contribution! We are forming the PicoClaw Dev Group to accelerate the evolution of the project. Any developer with more than one merged PR is invited to join. Would you like to join the PicoClaw Dev Group? If so, please send an email to |
emadomedher
pushed a commit
to emadomedher/picoclaw
that referenced
this pull request
Feb 17, 2026
…nterval fix(auth): support string interval in OpenAI device-code flow
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.
Summary
intervalis returned as a string (e.g.5)intervalvaluesWhy
picoclaw auth login --provider openai --device-codecurrently fails with:json: cannot unmarshal string into Go struct field .interval of type intOpenAI's device auth endpoint returns
intervalas a string in practice, so unmarshalling intointbreaks login.Changes
parseDeviceCodeResponseandparseFlexibleIntinpkg/auth/oauth.goLoginDeviceCodeto use the flexible parserTestParseDeviceCodeResponseIntervalAsNumberTestParseDeviceCodeResponseIntervalAsStringTestParseDeviceCodeResponseInvalidIntervalValidation
go test ./pkg/auth -run Test(ParseDeviceCodeResponse|BuildAuthorizeURL)Related