Skip to content

Ef/moonshot provider#6872

Closed
Evanfeenstra wants to merge 4 commits intoblock:mainfrom
Evanfeenstra:ef/moonshot-provider
Closed

Ef/moonshot provider#6872
Evanfeenstra wants to merge 4 commits intoblock:mainfrom
Evanfeenstra:ef/moonshot-provider

Conversation

@Evanfeenstra
Copy link
Contributor

Summary

Added moonshot provider. Since kimi reasoning output is in a different format that other models, it cant be added as a custom provider

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

  • unit tests
  • testing manually (tool use, streaming responses)

Related Issues

Relates to #ISSUE_ID
Discussion: LINK (if any)

Screenshots/Demos (for UX changes)

Before:

After:

Copilot AI review requested due to automatic review settings January 31, 2026 20:40
Signed-off-by: Evanfeenstra <evanfeenstra@gmail.com>
Signed-off-by: Evanfeenstra <evanfeenstra@gmail.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds native support for the Moonshot AI provider (with Kimi models) to goose, enabling direct integration without relying on OpenRouter or custom provider configurations. The Moonshot provider implements special handling for reasoning content in a format specific to Kimi models that differs from standard OpenAI-compatible APIs.

Changes:

  • Adds a new Moonshot provider with support for kimi-k2.5 and kimi-k2-thinking models
  • Implements custom format handling for Kimi's reasoning_content field in both streaming and non-streaming responses
  • Fixes a bug where CLI builtin extensions were incorrectly flagged as missing during session resume

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/goose/src/providers/moonshot.rs New provider implementation with OpenAI-compatible API handling and custom error parsing
crates/goose/src/providers/formats/moonshot.rs Custom format handlers for Moonshot's reasoning_content field, including streaming message parsing and tool call handling
crates/goose/src/providers/formats/mod.rs Registers moonshot format module
crates/goose/src/providers/mod.rs Registers moonshot provider module
crates/goose/src/providers/factory.rs Adds MoonshotProvider to the provider registry
crates/goose-cli/src/session/builder.rs Fixes false "missing extension" warnings for builtin extensions during session resume

Signed-off-by: Evanfeenstra <evanfeenstra@gmail.com>
Copilot AI review requested due to automatic review settings January 31, 2026 20:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Signed-off-by: Evanfeenstra <evanfeenstra@gmail.com>
Copy link
Collaborator

@michaelneale michaelneale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks - I think this makes sense. Moonshot kimi 2.5 work via openrouter etc but a challengfe direct, and it is big enough to warrant it with current architecture IMO

@DOsinga
Copy link
Collaborator

DOsinga commented Feb 1, 2026

before we merge this, can we think about whether we can do this with a custom provider? I see we need changes to the formatter, but can we add custom rendering so we can accomplish that? the provider code itself looks like a fairily standard openai provider?

making it easier to add custom/declarative providers makes the whole system stronger!

@DOsinga
Copy link
Collaborator

DOsinga commented Feb 13, 2026

any more thoughts on making this a custom provider? what would be needed?

@Evanfeenstra
Copy link
Contributor Author

@DOsinga sry been super busy lately!

what do you think? Should we make some small changes to openai formatting code to support this? Or create totally separate provider code and just try to use some parts of the openai format?

@DOsinga
Copy link
Collaborator

DOsinga commented Feb 13, 2026

I think using openai is the way - there's already some support there for different thinking modes. I could imagine this all ends with having a canonical provider class where you can specify how it handles thinking bits, similar to how you can now say, this one uses streaming. thoughts?

@stebbins
Copy link
Contributor

@DOsinga were you thinking something more like this approach?

moonshot support PR / kimi code support PR

note; they both implement the same changes to openai provider. I think this might improve deepseek reasoning_content handling as well, but I can't test as I don't have access.

@DOsinga
Copy link
Collaborator

DOsinga commented Feb 17, 2026

hi! yes - just approved that one with the note that it would be good if we could make sure deepseek still works :)

@DOsinga
Copy link
Collaborator

DOsinga commented Feb 18, 2026

ok, so closing this and we can merge the others

@DOsinga DOsinga closed this Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments