fix(agent): add CJK future-ack patterns for intent-ack continuation - #55681
fix(agent): add CJK future-ack patterns for intent-ack continuation#55681AlexFucuson9 wants to merge 1 commit into
Conversation
looks_like_codex_intermediate_ack() gates intent-ack continuation on an English-only regex (i'll|i will|let me|...). When the model replies in Chinese, Japanese, or Korean, the detector returns False and the turn ends after the model merely announces intent without executing any tool. Add CJK future-ack patterns: - Chinese: 我会/我先/让我/我来 - Japanese: 確認/調査/します/てくる - Korean: 하겠습니다/관찰 CJK languages don't use word boundaries (\b), so match substrings directly. Only checked when the English regex doesn't match. Fixes NousResearch#55664
Competing fix for #55664. This PR ( |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused CJK continuation fix. The underlying gap is still present on current main: agent/agent_runtime_helpers.py:2690-2735 recognizes only English future-ack and action markers, and agent/conversation_loop.py:5103-5133 relies on that detector before continuing.
Problems
agent/agent_runtime_helpers.py:2343changesi['’]lltoi['']ll; this removes support for typographic “I’ll”. Please preserve the existing curly-apostrophe alternative.- The added CJK values only affect the future-ack gate (
agent/agent_runtime_helpers.py:2348-2360). The followingaction_markerstuple remains English-only at lines 2364-2383, so the reported CJK acknowledgement still failsassistant_mentions_action. - No regression test accompanies the new detector behavior; current coverage is in
tests/agent/test_intent_ack_continuation.py.
Suggested changes
- Restore the original English regex and add CJK action/workspace markers needed by the same detector gates.
- Add positive and negative CJK tests that retain the current short-response, no-prior-tool, and workspace-mode contracts.
This is an automated hermes-sweeper review.
| # English future-ack patterns. | ||
| has_future_ack = bool( | ||
| re.search(r"\b(i['’]ll|i will|let me|i can do that|i can help with that)\b", assistant_text) | ||
| re.search(r"\b(i['']ll|i will|let me|i can do that|i can help with that)\b", assistant_text) |
There was a problem hiding this comment.
This changes the existing ['’] class to [''], which removes the typographic apostrophe alternative. Please preserve ’ so existing “I’ll inspect…” acknowledgements continue to match.
Summary
Add Chinese/Japanese/Korean future-ack patterns to
looks_like_codex_intermediate_ack()so intent-ack continuation fires for non-English responses.Problem (P2 #55664)
The detector gates intent-ack continuation on an English-only regex (
i'll|i will|let me|...). When the model replies in CJK languages (e.g. "我先載入 skill 確認用法…"), the detector returnsFalseand the turn ends after the model merely announces intent without executing any tool. The user must manually type "please continue" every turn.This is especially visible with Mixture-of-Agents (MoA) where the aggregator tends to summarize the response plan in the user's language.
Fix
Add CJK future-ack patterns as a fallback when the English regex doesn't match:
CJK languages don't use word boundaries (
\b), so match substrings directly. Only checked when the English regex doesn't match (no overhead for English responses).Changes
agent/agent_runtime_helpers.py: Add CJK future-ack tuple and fallback check (18 lines added)Fixes #55664