fix(permission): don't halt agent on permission rejection by default#11511
fix(permission): don't halt agent on permission rejection by default#11511Elshayib wants to merge 5 commits into
Conversation
…openai-compatible
MiMo and other OpenAI-compatible providers reject reasoning_effort: 'none'
(they only accept 'low', 'medium', 'high'). When user-provided variants
contain { reasoning: { effort: 'none' } }, rewrite them to
{ reasoning: { enabled: false } } so the SDK never sends an unsupported
effort value.
Fixes Kilo-Org#11501
Spread the original variant object (...v) so sibling keys like temperature are not dropped when replacing reasoning.effort. Addresses code review feedback on PR Kilo-Org#11510.
The connect() and disconnect() functions only modified in-memory state, so MCP server toggle changes were lost after restart. Now both functions update the enabled field in the project config file via cfgSvc.update(), bridging the gap between the runtime toggle endpoints (added Dec 2025) and the enabled config field (added Jun 2025). Fixes Kilo-Org#6157
When a user rejects a file read (or any tool permission), the agent should continue without the rejected tool call, not halt entirely. The previous default was to stop the agent loop on any rejection. Changes: - processor.ts: flip shouldBreak default from true to false - config.ts: add stop_on_deny config option (default false), deprecate continue_loop_on_deny Users who want the old behavior can set experimental.stop_on_deny: true. Fixes Kilo-Org#7338
| ctx.needsCompaction = false | ||
| ctx.compactionError = undefined // kilocode_change | ||
| ctx.shouldBreak = (yield* config.get()).experimental?.continue_loop_on_deny !== true | ||
| ctx.shouldBreak = (yield* config.get()).experimental?.stop_on_deny === true |
There was a problem hiding this comment.
WARNING: Existing continue_loop_on_deny settings become ineffective
processor.ts now only checks experimental.stop_on_deny, but the current VS Code settings UI still reads and writes experimental.continue_loop_on_deny (packages/kilo-vscode/webview-ui/src/components/settings/ExperimentalTab.tsx:162-163). That makes existing configs and the shipped toggle silently stop affecting runtime behavior unless the deprecated key is still aliased or migrated here.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| if (model.api.npm === "@ai-sdk/openai-compatible") { | ||
| return mapValues(model.variants, (v) => { | ||
| if (v?.reasoning?.effort === "none") { | ||
| return { ...v, reasoning: { enabled: false } } |
There was a problem hiding this comment.
WARNING: Nested reasoning options get discarded
This preserves top-level variant siblings, but it overwrites the entire reasoning object. Any existing nested keys alongside effort are lost when effort === "none", so the remap is not behavior-preserving for user-defined variants that carry additional reasoning settings.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (8 files)
Previous Review Summary (commit f52689f)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit f52689f)Status: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (7 files)
Reviewed by gpt-5.4-20260305 · Input: 47.9K · Output: 7.3K · Cached: 138.8K Review guidance: REVIEW.md from base branch |
|
Good catch on the backward compat. Fixed in the latest commit — |
|
Changeset added ( |
Summary
When a user rejects a file read (or any tool permission), the agent should continue without the rejected tool call, not halt entirely. The previous default was to stop the agent loop on any rejection, which is almost never the desired behavior.
Changes
packages/opencode/src/session/processor.ts: ChangedshouldBreakdefault fromtruetofalse. The agent now continues the loop when a permission is rejected, unlessexperimental.stop_on_denyis explicitly set totrue.packages/opencode/src/config/config.ts: Addedstop_on_denyconfig option (defaultfalse). Deprecatedcontinue_loop_on_denyin favor of the more intuitivestop_on_deny.Verification
bun test test/session/processor-effect.test.ts— all 14 tests passbun test test/permission-task.test.ts— all 8 tests passbun test test/cli/run/permission.shared.test.ts— all 18 tests passsession-prompt-permission-refresh.test.tsis unrelated (fails on main too)Testing Evidence
All existing processor and permission tests continue to pass. The behavior change is minimal: only the default value of
shouldBreakflips fromtruetofalse. Users who want the old behavior can setexperimental.stop_on_deny: truein their config.Fixes #7338