GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GLM 4.7 thinking process not properly formatted - missing leading tags · Issue #7779 · anomalyco/opencode

GLM 4.7 thinking process not properly formatted - missing leading tags #7779

New issue
Copy link
New issue
Copy link
Closed
Closed
GLM 4.7 thinking process not properly formatted - missing leading tags#7779
Copy link
Assignees
rekram1-node
Labels
bugSomething isn't working

Description

@ukyonagata0105
ukyonagata0105
opened on Jan 11, 2026
Issue body actions

Description

When using GLM 4.7 model, the thinking process is not being properly formatted. The opening tag (e.g., <think>) at the beginning of the thinking content is missing, causing all reasoning output to appear as plain text in the UI.

Expected Behavior

The thinking process should be wrapped with proper tags like:

<think>
[reasoning content]
</think>

This allows the UI to properly hide/display the thinking content.

Actual Behavior

Only the closing tag is present, or the entire reasoning appears as plain text without any formatting. The opening <think> tag is missing from the beginning of the thinking process.

Steps to Reproduce

  1. Configure opencode to use GLM 4.7 model (Zhipu AI)
  2. Ask a question that triggers tool usage or complex reasoning
  3. Observe the output - the thinking process appears as plain text instead of being properly formatted

Environment

  • Model: Zhipu GLM-4.7
  • Provider: Custom/Local LLM provider using vLLM or similar

Additional Context

This may be related to how the streaming response is parsed for GLM 4.7, specifically in the JSON parsing logic that handles reasoning_content fields.

Plugins

No response

OpenCode version

1.1.13

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. ukyonagata0105
    added
    bugSomething isn't working
    on Jan 11, 2026
  2. github-actions commented on Jan 11, 2026

    @github-actions
    github-actionsBot
    on Jan 11, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • [Bug] JSON Parse Error with Zhipu GLM-4.7: Stream chunks are concatenated incorrectly #7692: JSON Parse Error with Zhipu GLM-4.7 - stream chunks are concatenated incorrectly, which could cause parsing issues with thinking tags
    • GLM 4.7 on Zai coding plan puts tool calls inside the thinking/reasoning tag. #6708: GLM 4.7 on Zai coding plan puts tool calls inside the thinking/reasoning tag - related issue with thinking tag handling
    • Error: Invalid signature in thinking block #6418: Invalid signature in thinking block - thinking tag format errors when switching models from GLM 4.7
    • Error "reasoning part reasoning-0 not found" from tool calls using GLM 4.5 Air #6486: Reasoning part not found error from GLM tool calls - similar thinking/reasoning content parsing issues

    Feel free to ignore if none of these address your specific case.

  3. github-actions
    assigned
    rekram1-node
    on Jan 11, 2026
  4. goniz commented on Jan 11, 2026

    @goniz
    goniz
    on Jan 11, 2026
    Contributor
    More actions

    Hi, this issue is related to how you serve your local LLM.
    Your inference server (llama.cpp? Vllm?) needs to be correctly configured with the prompt template and to serve the correct fields of reasoning_content etc (depends on the API, completions/responses)

  5. pawanjenu commented on Jan 18, 2026

    @pawanjenu
    pawanjenu
    on Jan 18, 2026
    More actions

    facing the same issue. I use VLLM

  6. bsdayo commented on Feb 2, 2026

    @bsdayo
    bsdayo
    on Feb 2, 2026
    More actions

    For vLLM users, you need to add --reasoning-parser glm45 to your vllm serve command.

    Example:

    vllm serve GadflyII/GLM-4.7-Flash-NVFP4 \
        --enable-auto-tool-choice \
        --tool-call-parser glm47 \
        --reasoning-parser glm45

    References:

    • https://docs.vllm.ai/en/stable/features/reasoning_outputs/
    • https://docs.vllm.ai/projects/recipes/en/latest/GLM/GLM.html
    Reacted by Jihyeon Gim
  7. github-actions commented on Apr 4, 2026

    @github-actions
    github-actionsBot
    on Apr 4, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  8. github-actions
    closed this as completedon Apr 4, 2026
  9. saurav-shakya
    added a commit that references this issue on Apr 10, 2026

    fix: render think tags as reasoning blocks + fix MCP MaxListeners ove…

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

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.