Skip to content

Auto-reply: normalize stop matching and add multilingual triggers#25103

Merged
vincentkoc merged 10 commits intomainfrom
vincentkoc-code/stop-command-normalize-multilingual
Feb 24, 2026
Merged

Auto-reply: normalize stop matching and add multilingual triggers#25103
vincentkoc merged 10 commits intomainfrom
vincentkoc-code/stop-command-normalize-multilingual

Conversation

@vincentkoc
Copy link
Member

@vincentkoc vincentkoc commented Feb 24, 2026

Summary

Describe the problem and fix in 2–5 bullets:

  • Problem: stop/abort text matching only handled exact forms and missed common punctuation + multilingual standalone stop words.
  • Why it matters: users in non-English channels or with natural phrasing (for example stop please or /stop!!!) could fail to trigger fast abort/stop paths.
  • What changed: centralized normalization in abort matching (trim + lowercase + punctuation/whitespace normalization), added common stop words (EN/ES/FR/ZH/HI/AR/JP/DE/PT), and aligned gateway chat-stop parsing to reuse the same matcher.
  • What did NOT change (scope boundary): slash command authorization model and non-stop command parsing semantics.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #
  • Related #

User-visible / Behavior Changes

  • Standalone stop words now match in additional languages.
  • Stop commands tolerate trailing punctuation and casing variants (for example /STOP!!!).
  • stop please now routes through stop handling paths.

Security Impact (required)

  • New permissions/capabilities? (Yes/No) No
  • Secrets/tokens handling changed? (Yes/No) No
  • New/changed network calls? (Yes/No) No
  • Command/tool execution surface changed? (Yes/No) No
  • Data access scope changed? (Yes/No) No
  • If any Yes, explain risk + mitigation:

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: Node 22+
  • Model/provider: N/A
  • Integration/channel (if any): auto-reply + gateway chat + Telegram tests
  • Relevant config (redacted): default test config

Steps

  1. Send standalone stop forms like stop please, /STOP!!!, 停止, توقف, やめて, stopp, pare.
  2. Observe stop/abort detection in auto-reply and gateway chat paths.
  3. Verify non-stop commands such as /status are unaffected.

Expected

  • Stop/abort path triggers for the new standalone stop forms.

Actual

  • Matches expected after patch.

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios: targeted vitest run for abort detection, gateway chat stop parsing, and Telegram sequential key routing.
  • Edge cases checked: trailing punctuation, uppercase slash commands, multilingual stop words, and non-stop commands.
  • What you did not verify: full pnpm check and full repository test suite.

Compatibility / Migration

  • Backward compatible? (Yes/No) Yes
  • Config/env changes? (Yes/No) No
  • Migration needed? (Yes/No) No
  • If yes, exact upgrade steps:

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: revert this PR; stop detection returns to previous exact-match behavior.
  • Files/config to restore: src/auto-reply/reply/abort.ts and dependent tests.
  • Known bad symptoms reviewers should watch for: unintended aborts from unrelated text.

Risks and Mitigations

List only real risks for this PR. Add/remove entries as needed. If none, write None.

  • Risk: broader phrase matching could create false-positive aborts in edge conversational messages.
    • Mitigation: kept matching to normalized standalone trigger words/phrases only and added explicit negative tests for non-stop text.

Greptile Summary

This PR centralizes and enhances stop/abort text matching to support multilingual triggers and common punctuation variants. The changes successfully normalize user input through trim, lowercase, and punctuation removal in abort.ts:67-75, then route both slash commands (/stop) and standalone phrases through a unified matcher.

Key improvements:

  • Added multilingual stop words (ES/FR/ZH/HI/AR/JP/DE/PT) to ABORT_TRIGGERS
  • Added common stop phrases like "stop please" and "stop openclaw" to ABORT_TRIGGER_PHRASES
  • Gateway chat-abort.ts now delegates to isAbortRequestText instead of duplicating logic
  • Telegram bot correctly routes stop phrases to :control lane for sequential processing
  • Comprehensive test coverage for edge cases (punctuation, casing, multilingual)

Issue found:

  • Line 60 in abort.ts contains duplicate entry "stop don't do anything" (already present on line 56)

Confidence Score: 4/5

  • Safe to merge after fixing the duplicate entry in ABORT_TRIGGER_PHRASES
  • The implementation is well-designed with centralized normalization logic, comprehensive test coverage including edge cases (punctuation, casing, multilingual), and proper integration across multiple layers (auto-reply, gateway, Telegram). The only issue is a duplicate string in the trigger phrases set which should be removed. The normalization logic is conservative (trim, lowercase, strip trailing punctuation) and won't cause false positives. The risk of unintended aborts is mitigated by explicit negative test cases.
  • src/auto-reply/reply/abort.ts has a duplicate entry on line 60 that should be removed

Last reviewed commit: 54a10df

@vincentkoc vincentkoc marked this pull request as ready for review February 24, 2026 05:53
@openclaw-barnacle openclaw-barnacle bot added channel: telegram Channel integration: telegram gateway Gateway runtime size: S maintainer Maintainer-authored PR labels Feb 24, 2026
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

5 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@vincentkoc vincentkoc force-pushed the vincentkoc-code/stop-command-normalize-multilingual branch from 54a10df to 5604255 Compare February 24, 2026 05:58
@openclaw-barnacle openclaw-barnacle bot added size: XS and removed channel: telegram Channel integration: telegram size: S labels Feb 24, 2026
Copy link

@SamuelHinestrosa SamuelHinestrosa left a comment

Choose a reason for hiding this comment

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

Revisión automática: Cambios revisados. Por favor asegurar que los tests pasan.

@openclaw-barnacle openclaw-barnacle bot added channel: telegram Channel integration: telegram size: S and removed size: XS labels Feb 24, 2026
@vincentkoc vincentkoc merged commit 4b316c3 into main Feb 24, 2026
11 checks passed
@vincentkoc vincentkoc deleted the vincentkoc-code/stop-command-normalize-multilingual branch February 24, 2026 06:07
plgs2005 pushed a commit to plgs2005/openclaw that referenced this pull request Feb 24, 2026
…enclaw#25103)

* Auto-reply tests: cover multilingual abort triggers

* Auto-reply: normalize multilingual abort triggers

* Gateway: route chat stop matching through abort parser

* Gateway tests: cover chat stop parsing variants

* Auto-reply tests: cover Russian and German stop words

* Auto-reply: add Russian and German abort triggers

* Gateway tests: include Russian and German stop forms

* Telegram tests: route Russian and German stop forms to control lane

* Changelog: note multilingual abort stop coverage

* Changelog: add shared credit for abort shortcut update
jh280722 added a commit to jh280722/openclaw that referenced this pull request Feb 25, 2026
Add Korean (KO) stop keywords to the multilingual abort trigger set:
멈춰, 중지, 그만, 중단, 취소, 정지, 그만해, 멈춰줘, 중지해, 그만 해

Follows the same pattern established in openclaw#25103 for ES/FR/ZH/HI/AR/JP/DE/PT/RU.
Includes test coverage for auto-reply abort detection, gateway chat-stop
parsing, and Telegram sequential key routing.
margulans pushed a commit to margulans/Neiron-AI-assistant that referenced this pull request Feb 25, 2026
…enclaw#25103)

* Auto-reply tests: cover multilingual abort triggers

* Auto-reply: normalize multilingual abort triggers

* Gateway: route chat stop matching through abort parser

* Gateway tests: cover chat stop parsing variants

* Auto-reply tests: cover Russian and German stop words

* Auto-reply: add Russian and German abort triggers

* Gateway tests: include Russian and German stop forms

* Telegram tests: route Russian and German stop forms to control lane

* Changelog: note multilingual abort stop coverage

* Changelog: add shared credit for abort shortcut update
brianleach pushed a commit to brianleach/openclaw that referenced this pull request Feb 26, 2026
…enclaw#25103)

* Auto-reply tests: cover multilingual abort triggers

* Auto-reply: normalize multilingual abort triggers

* Gateway: route chat stop matching through abort parser

* Gateway tests: cover chat stop parsing variants

* Auto-reply tests: cover Russian and German stop words

* Auto-reply: add Russian and German abort triggers

* Gateway tests: include Russian and German stop forms

* Telegram tests: route Russian and German stop forms to control lane

* Changelog: note multilingual abort stop coverage

* Changelog: add shared credit for abort shortcut update
mylukin pushed a commit to mylukin/openclaw that referenced this pull request Feb 26, 2026
…enclaw#25103)

* Auto-reply tests: cover multilingual abort triggers

* Auto-reply: normalize multilingual abort triggers

* Gateway: route chat stop matching through abort parser

* Gateway tests: cover chat stop parsing variants

* Auto-reply tests: cover Russian and German stop words

* Auto-reply: add Russian and German abort triggers

* Gateway tests: include Russian and German stop forms

* Telegram tests: route Russian and German stop forms to control lane

* Changelog: note multilingual abort stop coverage

* Changelog: add shared credit for abort shortcut update
Get-windy pushed a commit to Get-windy/JieZi-ai-PS that referenced this pull request Feb 28, 2026
更新内容:
- fix(ui): prevent tabnabbing in chat images (openclaw#18685)
- fix(cli): replace stale doctor/restart command hints (openclaw#24485)
- Auto-reply: normalize stop matching + multilingual triggers (openclaw#25103)
- docs: fix broken links, add maintainer
r4jiv007 pushed a commit to r4jiv007/openclaw that referenced this pull request Feb 28, 2026
…enclaw#25103)

* Auto-reply tests: cover multilingual abort triggers

* Auto-reply: normalize multilingual abort triggers

* Gateway: route chat stop matching through abort parser

* Gateway tests: cover chat stop parsing variants

* Auto-reply tests: cover Russian and German stop words

* Auto-reply: add Russian and German abort triggers

* Gateway tests: include Russian and German stop forms

* Telegram tests: route Russian and German stop forms to control lane

* Changelog: note multilingual abort stop coverage

* Changelog: add shared credit for abort shortcut update
AytuncYildizli added a commit to AytuncYildizli/openclaw that referenced this pull request Feb 28, 2026
Add missing language coverage to the ABORT_TRIGGERS set:
- Turkish (tr): 'dur', 'iptal'
- Korean (ko): '멈춰'
- Italian (it): 'fermati'

These languages were omitted from the multilingual expansion in openclaw#25103.
Follows the same conservative pattern: 1-2 entries per language, matching
the baseline established for Arabic (1), Hindi (1), Chinese (1),
and Portuguese (1).

Relates to openclaw#26113 (configurable abort triggers) — this is a stopgap
fix for the most-requested missing languages. A proper config-driven
solution is tracked in that issue.

Tests: extended isAbortTrigger and isAbortRequestText coverage for all
three new locales.
AytuncYildizli added a commit to AytuncYildizli/openclaw that referenced this pull request Feb 28, 2026
…hrases

Implements openclaw#26113: users can now extend the built-in ABORT_TRIGGERS set
with their own language-specific or workflow-specific stop phrases via
openclaw.json, without waiting for a release.

  {
    "session": {
      "abortTriggers": ["dur", "yeter", "그만", "custom-stop"]
    }
  }

Changes:
- abort.ts: isAbortTrigger() and isAbortRequestText() accept optional
  extraTriggers param; normalization pipeline (lowercase, trim,
  punctuation strip) applies to extra triggers consistently
- command-detection.ts: passes cfg.session?.abortTriggers through
  isControlCommandMessage for the main detection path
- get-reply-inline-actions.ts: passes cfg.session?.abortTriggers into
  isAbortRequestText for the inline abort path
- types.base.ts: SessionConfig gains optional abortTriggers field
- zod-schema.session.ts: SessionSchema gains optional abortTriggers
  string array
- schema.labels.ts + schema.help.ts: documentation for the new field

The built-in ABORT_TRIGGERS set is preserved as-is and remains the
baseline. extraTriggers augments it — no existing behaviour changes for
users who do not set the new config field.

Closes openclaw#26113
Related: openclaw#25103, openclaw#30102
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…enclaw#25103)

* Auto-reply tests: cover multilingual abort triggers

* Auto-reply: normalize multilingual abort triggers

* Gateway: route chat stop matching through abort parser

* Gateway tests: cover chat stop parsing variants

* Auto-reply tests: cover Russian and German stop words

* Auto-reply: add Russian and German abort triggers

* Gateway tests: include Russian and German stop forms

* Telegram tests: route Russian and German stop forms to control lane

* Changelog: note multilingual abort stop coverage

* Changelog: add shared credit for abort shortcut update
jh280722 added a commit to jh280722/openclaw that referenced this pull request Mar 7, 2026
Add Korean (KO) stop keywords to the multilingual abort trigger set:
멈춰, 중지, 그만, 중단, 취소, 정지, 그만해, 멈춰줘, 중지해, 그만 해

Follows the same pattern established in openclaw#25103 for ES/FR/ZH/HI/AR/JP/DE/PT/RU.
Includes test coverage for auto-reply abort detection, gateway chat-stop
parsing, and Telegram sequential key routing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram gateway Gateway runtime maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants