Skip to content

Ef/moonshot provider#6872

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

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!

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.

3 participants