Skip to content

[Bug]: /onboard-github failure (invalid_scope) and CLI crash (TypeError: trim) when using GitHub Models #293

@antithezis

Description

@antithezis

Summary

Onboarding GitHub Models via /onboard-github fails using the device code method due to an invalid_scope error. While Personal Access Token (PAT) onboarding completes, the CLI becomes unusable, throwing a "Request too large" error for simple messages and crashing with a TypeError when running /model.

Steps to Reproduce

  1. Run /onboard-github using the device code method.

  2. Attempt a workaround by using a PAT for onboarding.

  3. Once "successfully" onboarded, try to send a simple message like "Hi".

  4. Run the /model command to switch or verify models.

Expected Behavior

  1. Device code onboarding should successfully request and authorize the necessary scopes.

  2. After PAT onboarding, the application should allow sending messages and switching models without crashing.

Actual Behavior

  • Device Code Auth: Fails with: "Device code request failed: 400 {"error":"invalid_scope","error_description":"The scopes requested are invalid:models:read.","error_uri":"https://docs.github.com"}"

  • Messaging: Every message (even simple text) triggers: Request too large (max 20MB). Double press esc to go back and try with a smaller file.

  • /model command: The CLI crashes with a TypeError: Cannot read properties of undefined (reading 'trim') at parseUserSpecifiedModel.

Environment

  • OpenClaude version: v0.1.7

  • OS: macOS 26.4

  • Terminal: Ghostty

  • Provider: GitHub Models (intended)

  • Model: None (cannot select due to crash)

Logs / Screenshots

Plaintext

ERROR
Cannot read properties of undefined (reading 'trim') 
at parseUserSpecifiedModel (file:///opt/homebrew/lib/node_modules/@gitlawb/openclaude/dist/cli.mjs:108601:40) 
at renderDefaultModelSetting (file:///opt/homebrew/lib/node_modules/@gitlawb/openclaude/dist/cli.mjs:108491:26) 
at getDefaultOptionForUser (file:///opt/homebrew/lib/node_modules/@gitlawb/openclaude/dist/cli.mjs:343668:54) 
at getModelOptionsBase (file:///opt/homebrew/lib/node_modules/@gitlawb/openclaude/dist/cli.mjs:343933:26) 
at getModelOptions (file:///opt/homebrew/lib/node_modules/@gitlawb/openclaude/dist/cli.mjs:344012:20) 
at ModelPicker (file:///opt/homebrew/lib/node_modules/@gitlawb/openclaude/dist/cli.mjs:385782:10)

Additional Context

  • Restarting openclaude does not resolve the issue.

  • The errors persist even after the tool indicates the token was stored correctly in secure storage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions