Skip to content

Apply Kimi effort per run without editing the user's config, and stop OpenCode turns stalling on questions - #1671

Merged
currentbits merged 2 commits into
mainfrom
coder/adapter-upgrades-from-the-provider-cli-d-3b8344
Oct 18, 2026
Merged

currentbits merged 2 commits into
mainfrom
coder/adapter-upgrades-from-the-provider-cli-d-3b8344

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Kimi thread effort no longer works by rewriting the user's config.toml around each spawn. It now travels as KIMI_MODEL_THINKING_EFFORT on the child's environment, which kimi 0.39 reads per process. As a side effect, ssh/WSL kimi runs now get effort too; the old flip only ever edited the local config. OpenCode turns now identify as OPENCODE_CLIENT=solenta. Part of #451.

Changes

  • Kimi effort via env. flipKimiEffort, its backup sidecar and the first-output restore hooks are gone. The env is merged before resolveSpawn, so remote spawns get it through wrapCommand.
  • Effort gated per model. The env override skips kimi's own support_efforts check, so it's only set when honouredEfforts(entry, model) lists the level. A leftover effort after a model switch (e.g. max on kimi-for-coding) never reaches the API.
  • OpenCode client name. Thread and workflow turns set OPENCODE_CLIENT=solenta. opencode 1.17 only registers its question tool for app/cli/desktop clients, so headless runs also lose a tool nobody can answer. The ask and commit-message one-shots are unchanged.

Verification

  • Read kimi 0.39.1 and opencode 1.17.12 binaries to confirm both env vars and the question-tool gate exist.
  • Runner-level tests: thread effort reaches the child env, config.toml stays byte-identical, an undeclared effort is not sent, and opencode children see OPENCODE_CLIENT=solenta.
  • npm run test:electron with inherited CODER_* vars stripped, after rebasing on main: 4870 pass, 0 fail, 0 cancelled.
  • Not tested: a live kimi or opencode model turn.

Notes for reviewers

  • A kimi older than the env var ignores effort and runs on the user's default, where the flip used to apply it.
  • If a past crash left a .coder-effort-backup next to the user's real kimi config, it is no longer auto-restored.
  • Deliberately left out of Adapter upgrades from the provider-CLI deep-dives #451 (see the issue comment):
    • Codex worktree trust: Codex 0.159.2 already inherits trust from the main checkout (probed live).
    • OPENCODE_DISABLE_CLAUDE_CODE: it also drops the project's CLAUDE.md instructions.
    • KIMI_MODEL_NAME: it needs a raw API key.
    • The opencode serve migration: offered as a separate thread.

🤖 Generated with Claude Code

Kimi: drop the config.toml flip. Effort now rides KIMI_MODEL_THINKING_EFFORT
on the child env (kimi 0.39), merged before resolveSpawn so ssh/WSL runs get
it too. The env bypasses kimi's support_efforts, so it is only set when
honouredEfforts(entry, model) lists the level.

OpenCode: thread and workflow turns set OPENCODE_CLIENT=solenta, which also
drops the question tool that headless `opencode run` cannot answer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T20:46:54.968149Z 88c0dcf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 88c0dcf411

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
const effortEnv = kimiParse.kimiEffortEnv(
thread.reasoningEffort,
honouredEfforts(providerEntry, thread.model || null),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require a known Kimi model before exporting effort

When the thread uses Default or a custom Kimi alias, honouredEfforts() deliberately falls back to the provider-wide K3 list rather than the effective model's capabilities. If the user's default/custom alias is one of the coding models without support_efforts, this therefore exports KIMI_MODEL_THINKING_EFFORT even though the new environment override bypasses Kimi's capability check, allowing an unsupported level to reach the API. The mirrored workflow call has the same issue; only export the variable for an explicitly recognized model with a matching per-model effort list, or resolve the effective model first.

Useful? React with 👍 / 👎.

@currentbits
currentbits merged commit 0d59bbe into main Oct 18, 2026
6 checks passed
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.

1 participant