Skip to content

fix(agent): add CJK future-ack patterns for intent-ack continuation - #55681

Open
AlexFucuson9 wants to merge 1 commit into
NousResearch:mainfrom
AlexFucuson9:fix/intent-ack-cjk-support
Open

fix(agent): add CJK future-ack patterns for intent-ack continuation#55681
AlexFucuson9 wants to merge 1 commit into
NousResearch:mainfrom
AlexFucuson9:fix/intent-ack-cjk-support

Conversation

@AlexFucuson9

Copy link
Copy Markdown
Contributor

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 returns False and 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:

  • Chinese: 我会/我先/让我/我来
  • Japanese: 確認/調査/します/てくる
  • Korean: 하겠습니다/관찰

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

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
@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists labels Jun 30, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Competing fix for #55664. This PR (agent_runtime_helpers.py only, +18 lines, future-ack patterns) is a subset of the broader open PR #55670, which adds CJK future-ack and action/workspace markers (simplified+traditional) plus 5 regression tests. #55670 looks canonical here (earlier, broader, has test coverage). Flagging the cluster so a maintainer can pick — not closing either. Related: #26913 (open Chinese-ack), #22059 (open French extension) — same detector, different languages.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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:2343 changes i['’]ll to i['']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 following action_markers tuple remains English-only at lines 2364-2383, so the reported CJK acknowledgement still fails assistant_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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This changes the existing ['’] class to [''], which removes the typographic apostrophe alternative. Please preserve so existing “I’ll inspect…” acknowledgements continue to match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

intent-ack continuation never fires for non-English (CJK) responses — English-only regex in looks_like_codex_intermediate_ack

3 participants