fix(agent): add CJK future-ack and action markers to intent-ack continuation detector - #55670
Open
liuhao1024 wants to merge 1 commit into
Open
liuhao1024 wants to merge 1 commit into
liuhao1024 wants to merge 1 commit into
Conversation
…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.
This was referenced Jun 30, 2026
19 tasks
teknium1
reviewed
Jul 15, 2026
teknium1
left a comment
Collaborator
There was a problem hiding this comment.
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:2348in 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 atagent/agent_runtime_helpers.py:2690-2694on 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 |
Collaborator
There was a problem hiding this comment.
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.
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.
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
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
pytest tests/agent/test_intent_ack_continuation.py -v— all 19 tests should pass (14 existing + 5 new CJK tests)Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A