Skip to content

opencode zen models tool calls are not parsed correctly mid conversation #3561

Closed

Description

@tsah

Description

Switching models mid conversation leads to tool calls not being parsed.

Happened to me today while switching from sonnet 4.5 to kimi k2, happened to me in the past with GLM and big pickle as well

OpenCode version

0.15.29

Steps to reproduce

  1. started conversation in plan mode with sonnet 4.5 (anthropic api key)
  2. switched to build mode with kimi k2 (zen)
  3. Got weird output that looks to me like tool calls that are not parsed correctly

Screenshot and/or share link

Image

Operating System

Arch

Terminal

Ghostty + tmux

Activity

  1. added
    bugSomething isn't working
    on Oct 30, 2025
  2. github-actions commented on Oct 30, 2025

    @github-actions
    Contributor

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

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

  3. tsah commented on Oct 30, 2025

    @tsah
    Author

    Yeah looks like a duplicate of 1021

  4. tsah commented on Oct 30, 2025

    @tsah
    Author

    Addition: when switching back to anthropic the problem disappears

  5. rekram1-node commented on Oct 30, 2025

    @rekram1-node
    Collaborator

    this is just the model failing to call tools, it isnt calling them correctly, this can happen for many providers and models just happens more frequently with some than others

  6. Adictya commented on Dec 5, 2025

    @Adictya
    Contributor

    This happens consistently with kimi k2 thinking. Is there any recommended way to work around it? @rekram1-node

    Image
  7. self-assigned this
    on Dec 5, 2025
  8. rekram1-node commented on Dec 9, 2025

    @rekram1-node
    Collaborator

    This should be fixed in next release:
    df64612

  9. DamianPereira commented on Dec 12, 2025

    @DamianPereira

    I tried 1.0.150 and it's still happening. Not sure if it's happening less or not.

    Image
  10. rekram1-node commented on Dec 12, 2025

    @rekram1-node
    Collaborator

    @DamianPereira yeah this is an upstream bug for us, our kimi k2 thinking provider (for zen) has a bug on their end, once they fix it this should resolve.

    Basically if I enable proper interleaved thinking for kimi k2 thinking on their inference rn, it would loop infinitely (bug on their end), so rn I can't use interleaved thinking for it yet which is why sometimes it does dumb stuff like what you are seeing there.

  11. rekram1-node commented on Dec 12, 2025

    @rekram1-node
    Collaborator

    I'll update once it has been addressed!

  12. DamianPereira commented on Dec 12, 2025

    @DamianPereira

    Thanks a lot for the fix and quick answer.

  13. Adictya commented on Dec 13, 2025

    @Adictya
    Contributor

    can confirm the fix is working beautifully, thanks 👍🏻

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

Metadata

Metadata

Assignees

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