fix: rewrite repeated tool call reminders to redirect instead of prohibit - #1518
Merged
Conversation
…ibit The r1/r2/r3 reminders injected into repeated tool results led with prohibition verdicts and, in r2, echoed the repeated tool name and full arguments back into the context, reinforcing the very pattern they were meant to break. Rewrite them to state the situation factually and hand the model a concrete next action: an expectation-setting sentence for the next call (r1), a forced decision menu of falsify / ask-user / conclude (r2), and a final hand-off summary without further tool calls (r3). Detection, thresholds (3/5/8/12), force-stop, and telemetry are unchanged.
|
commit: |
7723qqq
pushed a commit
to 7723qqq/kimi-code
that referenced
this pull request
Jul 11, 2026
…ibit (MoonshotAI#1518) The r1/r2/r3 reminders injected into repeated tool results led with prohibition verdicts and, in r2, echoed the repeated tool name and full arguments back into the context, reinforcing the very pattern they were meant to break. Rewrite them to state the situation factually and hand the model a concrete next action: an expectation-setting sentence for the next call (r1), a forced decision menu of falsify / ask-user / conclude (r2), and a final hand-off summary without further tool calls (r3). Detection, thresholds (3/5/8/12), force-stop, and telemetry are unchanged.
sailist
added a commit
to sailist/kimi-code
that referenced
this pull request
Jul 13, 2026
…th v1 - rewrite repeated tool call reminders to redirect instead of prohibit (port of v1 MoonshotAI#1518) - simplify makeReminderText2 to (repeatCount), no longer echoing tool name and args - treat dismissed AskUserQuestion as no answer, not the recommended pick (port of v1 MoonshotAI#1550) - update toolDedupe test assertions and regenerate affected wire snapshots
5 tasks
sailist
added a commit
that referenced
this pull request
Jul 13, 2026
… with v1 (#1631) * fix(agent-core-v2): surface provider rejection on post-refresh 401 - map a 401 that survives forced token refresh to PROVIDER_AUTH_ERROR carrying the provider's sanitized message, instead of a misleading AUTH_LOGIN_REQUIRED re-login prompt - propagate provider auth errors through full compaction instead of wrapping them as compaction failure - export sanitizeStatusErrorMessage for reuse * fix(agent-core-v2): align repeat-reminder and AskUserQuestion copy with v1 - rewrite repeated tool call reminders to redirect instead of prohibit (port of v1 #1518) - simplify makeReminderText2 to (repeatCount), no longer echoing tool name and args - treat dismissed AskUserQuestion as no answer, not the recommended pick (port of v1 #1550) - update toolDedupe test assertions and regenerate affected wire snapshots * chore: add changeset for v2 reminder and question copy alignment * fix(kap-server): drain in-flight heartbeat writes before unlinking the instance file - count writes that passed the released check and await them in release() so their atomic rename cannot recreate the file after unlink - harden the heartbeat test: 1ms cadence plus a post-release re-check catches the recreate-after-unlink race (verified failing on old code) * docs(agent-core-v2): move toProviderAuthError rationale to the file header Address Codex review: agent-core-v2 keeps comments in the top-of-file header only, never beside functions
jannes-apollo
added a commit
to jannes-apollo/inspect_swe
that referenced
this pull request
Jul 16, 2026
- mcp.json: translate http/sse MCP servers natively (fixes bridged_tools, which arrive as MCPServerConfigHTTP), honor stdio cwd, and map MCPServerConfig.tools -> kimi enabledTools - repeat-reminder strip: match kimi's actual reminder texts in both wordings (rewritten in kimi-code 0.23.4, MoonshotAI/kimi-code#1518); strip escalation tiers 1-2 only, keeping the tier-3 "write your final response" reminder that precedes kimi's forced turn stop; document the behavior in kimi_code.qmd - move the tool_call_id dedupe into the bridge filter (pre-generation) so rewritten ids land in recorded ModelEvents and live provider requests, not just the returned state; make the rewrite idempotent across bridge retries - dispatch legacy str-first GenerateFilters with model.name, mirroring the bridge's own annotation-based dispatch - centaur: don't bake --output-format text into the interactive alias (kimi rejects it outside prompt mode) - raise at resolution time on musl platforms (kimi publishes glibc-only linux builds); document glibc+bash sandbox requirements - escape user-supplied strings in config.toml via _format_value - tests: cover the above; drop redundant patch in unknown-platform test Co-Authored-By: Claude
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.
Related Issue
None — the problem is explained below.
Problem
When the agent repeats the exact same tool call, the turn loop appends a
<system-reminder>to the repeated tool result at streaks 3/5/8 (and force-stops the turn at 12). Two aspects of the current wording work against the goal:Net effect: the reminder meant to break a loop instead keeps the loop's target maximally salient.
What changed
Rewrote the three reminder texts (r1/r2/r3) in the tool-repeat dedup logic so each tier states the situation factually and hands the model a concrete next action, mirroring the "tell the model what to do, not what to avoid" guidance:
Deliberately out of scope: detection logic, thresholds (3/5/8/12), same-step dedup, force-stop behavior, and telemetry are all unchanged.
makeReminderText2(toolName, repeatCount, args)is simplified tomakeReminderText2(repeatCount)since the tool name and arguments are no longer injected.Tests: assertions in
tool-dedup.test.tswere updated to pin the new wording, including negative checks that tier texts do not leak into one another. 35 tool-dedup unit tests and 58 turn integration tests pass; typecheck and lint are clean.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.