Skip to content

fix(agent): add CJK future-ack and action markers to intent-ack continuation detector - #55670

Open
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:liuhao/cron-bugfix-55664-cjk-intent-ack
Open

liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:liuhao/cron-bugfix-55664-cjk-intent-ack

Conversation

@liuhao1024

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds CJK (Chinese/Japanese/Korean) patterns to the looks_like_codex_intermediate_ack() intent-ack continuation detector. Currently the detector only recognizes English future-ack phrases ("I'll", "let me", "I will") and English action/workspace markers, so intent-ack continuation never fires for non-English model responses — the user must manually type "please continue" every turn.

Related Issue

Fixes #55664

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • agent/agent_runtime_helpers.py: Added CJK future-ack substring patterns (我来/我來, 让我/讓我, 我先, 我可以, 我会) as a fallback when the English regex doesn't match. Added CJK action markers (查看, 检查/檢查, 分析, etc.) and workspace markers (目录/目錄, 文件/檔案, 项目/專案, etc.) covering both simplified and traditional Chinese.
  • tests/agent/test_intent_ack_continuation.py: Added 5 regression tests covering CJK future-ack + action firing, CJK workspace detection under codex_only mode, negative cases (future-ack without action, action without future-ack), and traditional Chinese support.

How to Test

  1. Run pytest tests/agent/test_intent_ack_continuation.py -v — all 19 tests should pass (14 existing + 5 new CJK tests)
  2. The new tests verify: CJK ack fires with action marker, CJK workspace detection works, CJK ack without action does NOT fire, action without future-ack does NOT fire, traditional Chinese patterns work

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 26.4.1

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

…nuation detector

The `looks_like_codex_intermediate_ack()` function gates intent-ack
continuation on an English-only future-ack regex ("I'll", "I will",
"let me", etc.) and English-only action/workspace markers. When the
model replies in Chinese or other CJK languages, the detector always
returns False, so intent-ack continuation never fires — the user must
manually type "please continue" every turn.

Add CJK substring patterns for:
- Future-ack: 我来/我來, 让我/讓我, 我先, 我可以, 我会 (simplified + traditional)
- Action markers: 查看, 检查/檢查, 分析, 搜索/搜尋, etc.
- Workspace markers: 目录/目錄, 文件夹/檔案夾, 文件/檔案, etc.

CJK characters lack word boundaries, so use substring matching
(``any(p in text for p in patterns)``) instead of ``\b`` regex.
@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

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for targeting the active continuation detector and preserving its existing short-response, no-prior-tool, and action-marker guards.

Problems

  • The advertised CJK scope is not implemented fully: the future-ack tuple at agent/agent_runtime_helpers.py:2348 in this PR contains only Chinese phrases, and the five added tests are all Chinese. Japanese and Korean responses still fail the English-only gate currently at agent/agent_runtime_helpers.py:2690-2694 on main.

Suggested changes

  • Either narrow the PR’s title/body to Chinese support, which matches the concrete reproduction in #55664, or add representative Japanese and Korean future-ack/action cases plus positive and negative helper tests.

Automated hermes-sweeper review.

# characters, so use substring matching instead.
if not has_future_ack:
_cjk_future_ack = (
"我来", "让我", "我先", "我可以", "我会", # simplified

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The PR describes CJK support, but this tuple contains Chinese-only phrases and the added tests are also Chinese-only. Please either add representative Japanese/Korean future-ack and action cases or narrow the stated scope to Chinese support.

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