fix: disable thinking on Moonshot calls so kimi-k2.6 populates content#623
Closed
jasonm4130 wants to merge 1 commit into
Closed
fix: disable thinking on Moonshot calls so kimi-k2.6 populates content#623jasonm4130 wants to merge 1 commit into
jasonm4130 wants to merge 1 commit into
Conversation
This was referenced Apr 30, 2026
jasonm4130
force-pushed
the
fix/kimi-disable-thinking
branch
from
April 30, 2026 11:40
7835fec to
b97ba3a
Compare
kimi-k2.6 is a reasoning model that writes its chain-of-thought to
`reasoning_content` and the answer to `content`. With graphify's default
`max_completion_tokens=8192`, large chunks (the default 20-file batches
frequently produce 50k+ token user messages) cause reasoning to consume
the entire output budget — `content` comes back empty, graphify parses
zero nodes, and the user pays for input + reasoning tokens without
getting a graph.
Reproduction on a 162-file repo (~125k words):
- Before: 9 chunks × 8192 tokens = ~74k completion tokens → 2 nodes total
- After: same chunks → 138 nodes (chunk 1 alone: 42 nodes / 75 edges)
Moonshot's API exposes `extra_body={"thinking": {"type": "disabled"}}`.
For structured graph extraction we don't need chain-of-thought, so disable
it for Moonshot endpoints only — other OpenAI-compatible providers (real
OpenAI, Together, Groq) would 400 on the flag.
jasonm4130
force-pushed
the
fix/kimi-disable-thinking
branch
from
April 30, 2026 12:07
b97ba3a to
528a3d2
Compare
|
Hi, tests/test_llm.py patches Severity: action required | Category: reliability How to fix: Install or skip openai tests Agent prompt to fix - you can give this to your LLM of choice:
We noticed a couple of other issues in this PR as well - happy to share if helpful. Found by Qodo code review |
matzls
pushed a commit
to matzls/graphify
that referenced
this pull request
May 10, 2026
…bs#638 Graphify-Labs#589 Graphify-Labs#586 Graphify-Labs#593: kimi thinking, manifest, inline comments, query boost, cache race, markdownify, content hash Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
thinkingmode for kimi-k2.6 by passingextra_body={"thinking": {"type": "disabled"}}on the OpenAI-compatible call"moonshot" in base_urlso other OpenAI-compatible providers (real OpenAI, Together, Groq) aren't affected — they'd 400 on the flagWhy
kimi-k2.6is a reasoning model. Its OpenAI-compatible response splits across two fields:With
max_completion_tokens=8192, large chunks (the defaultchunk_size=20regularly produces 50k+ token user messages) cause reasoning to consume the entire output budget.contentcomes back empty,_parse_llm_json("{}")returns{"nodes":[],...}, and the chunk silently contributes nothing.Reproduction
162-file repo (~125k words, mixed code/docs/images), default settings:
The 71k output tokens before were almost entirely
reasoning_contentthat graphify ignores. Emptycontent, empty graph, full bill.Test plan
test_kimi_call_disables_thinking— verifies the flag is sent on a moonshot URLtest_non_moonshot_call_does_not_disable_thinking— verifies the flag is not sent onapi.openai.com