Skip to content

failed to send message: POST "http://127.0.0.1:53737/session/ses_7fcdb17a2ffeA A8MIzJJs741C/message": 400 Bad Request {"name":"UnknownError","data":{"message":"TypeErro r: undefined is not an object (evaluating 'U0.tokens.input')"}} #942

Closed

Description

@Dhruv2mars
Image

Activity

  1. rahul-s-bhatt commented on Jul 13, 2025

    @rahul-s-bhatt

    I m getting same issue when trying to hook it up to a local model via LMStudio.

    Tested methods:

    • Deleted the .config/opencode and .cache/opencode and restarted couple of times.

    Below is the opencode.json for the same.
    { "$schema": "https://opencode.ai/config.json", "provider": { "lmstudio": { "npm": "@ai-sdk/openai-compatible", "name": "LM Studio (local)", "options": { "baseURL": "http://127.0.0.1:1234/v1" }, "models": { "lm-studio/phi-3-mini-4k-instruct": { "name": "phi-3-mini-4k-instruct" } } } } }

  2. self-assigned this
    on Jul 14, 2025
  3. adityaagarw commented on Jul 26, 2025

    @adityaagarw

    I m getting same issue when trying to hook it up to a local model via LMStudio.

    Tested methods:

    * Deleted the .config/opencode and .cache/opencode and restarted couple of times.
    

    Below is the opencode.json for the same. { "$schema": "https://opencode.ai/config.json", "provider": { "lmstudio": { "npm": "@ai-sdk/openai-compatible", "name": "LM Studio (local)", "options": { "baseURL": "http://127.0.0.1:1234/v1" }, "models": { "lm-studio/phi-3-mini-4k-instruct": { "name": "phi-3-mini-4k-instruct" } } } } }

    For local LLMs , it usually means that the input is greater than the context window (Do check LMStudio server logs). The system prompt along with other prompts might be exceeding your context window. Default 4k context window is too low.

  4. blackhaj commented on Jul 31, 2025

    @blackhaj

    I had the same issue. Jacking up the context length fixed it:

    Image
  5. blackhaj commented on Jul 31, 2025

    @blackhaj

    That said, I still get other errors. It does input a response before throwing the error at least

    Image
  6. yagil commented on Aug 1, 2025

    @yagil

    That said, I still get other errors. It does input a response before throwing the error at least

    Image

    Hey! We have fixes to this in the latest beta: https://lmstudio.ai/beta-releases

  7. jayair commented on Aug 2, 2025

    @jayair
    Contributor

    nice @yagil

  8. rekram1-node commented on Dec 28, 2025

    @rekram1-node
    Contributor

    [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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