Skip to content

tests: Add additional abort phrases to tests - #61067

Closed
alosslessdev wants to merge 1 commit into
openclaw:mainfrom
alosslessdev:patch-1
Closed

alosslessdev wants to merge 1 commit into
openclaw:mainfrom
alosslessdev:patch-1

Conversation

@alosslessdev

Copy link
Copy Markdown

Summary

Describe the problem and fix in 2–5 bullets:

Problem: The OpenClaw agent stop commands were for the most part tested in english and languages in developed countries, making it risky for users with other mother languages to interrupt the agent in an emergency.

Why it matters: Safety and accessibility; users need to be able to halt agent execution in their native language to prevent unwanted actions. It is important to ensure agents are controllable in as many languages as possible.

What changed: Added localized "stop" and "interrupt" string arrays for Spanish, French, Arabic, Hindi and one in English.

What did NOT change (scope boundary): This PR only adds trigger strings; it does not change the underlying orchestration logic of how the "stop" signal is processed.

Change Type (select all)

  • [ x] Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

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

User-visible / Behavior Changes

None

Diagram (if applicable)

N/A

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

Human Verification (required)

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

  • Verified scenarios: Test coverage was severely lacking in Spanish, Hindi, Arabic and to a lesser extent in French,
  • Edge cases checked: common phrases in the above languages that were missing
  • What you did not verify: Did not verify right-to-left (RTL) rendering in the UI for Arabic, only the string matching logic.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.

Compatibility / Migration

  • Backward compatible? (Yes/No) Yes
  • Config/env changes? (Yes/No) No
  • Migration needed? (Yes/No) No

Risks and Mitigations

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

  • Risk: None
    • Mitigation: None

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bacd7569f4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

"STOP OPENCLAW",
"stop openclaw!!!",
"stop don’t do anything",
"cancel",

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.

P1 Badge Align new positive abort phrases with runtime trigger list

Adding "cancel" (and the other newly added localized phrases in this block) to the positive isAbortTrigger table makes this test fail immediately, because isAbortTrigger only checks ABORT_TRIGGERS in src/auto-reply/reply/abort-primitives.ts, and those new strings are not present there. In this commit, the loop at abort.test.ts:294 will assert true for values the production matcher currently returns false, so CI is red unless the runtime trigger set is updated in the same change.

Useful? React with 👍 / 👎.

@greptile-apps

greptile-apps Bot commented Apr 4, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds 23 multilingual abort phrases (Spanish, French, Hindi, Arabic, and \"cancel\" in English) to the isAbortTrigger positive-match test list in src/auto-reply/reply/abort.test.ts. The stated goal — improving safety and accessibility by covering more languages — is a worthwhile improvement to the abort-detection system.

However, the PR is incomplete: it only adds the phrases to the test assertions but does not add them to the production ABORT_TRIGGERS set in src/auto-reply/reply/abort-primitives.ts, which is the sole source of truth that isAbortTrigger() checks. As a result, all 23 new test cases will fail when pnpm test is run, and none of the advertised multilingual abort phrases actually work at runtime.

  • P0 — Tests will fail: All new expect(isAbortTrigger(candidate)).toBe(true) assertions will return false against the current production code. src/auto-reply/reply/abort-primitives.ts must be updated to add all new phrases to ABORT_TRIGGERS before this can land.
  • P2 — Trailing whitespace: Four of the new Hindi string lines (273–276) have a trailing space after the comma, which will cause the Oxfmt format gate to fail."

Confidence Score: 1/5

Not safe to merge — every new test assertion will fail against the current production implementation.

The PR tests behavior that does not exist yet: none of the 23 added phrases are present in the ABORT_TRIGGERS set in abort-primitives.ts. The entire new test block will fail on pnpm test. The implementation file must be updated before this lands.

src/auto-reply/reply/abort-primitives.ts must be updated to include all new phrases in ABORT_TRIGGERS; src/auto-reply/reply/abort.test.ts lines 273-276 have trailing whitespace.

Comments Outside Diff (1)

  1. src/auto-reply/reply/abort.test.ts, line 251-293 (link)

    P0 Tests will fail — implementation not updated

    All 23 newly added phrases ("cancel", "para", "no lo hagas", "no hagas eso", "detenlo", "no hagas nada", "cancela", "basta", "no sigas", "deja eso", "alto", "corta", "abortar", "avorter", "interrompre", "रुकिए", "बंद करो", "खत्म करो", "बाहर निकलें", "निरस्त करें", "قف", "إلغاء", "خروج") are asserted to return true from isAbortTrigger(), but none of them exist in the ABORT_TRIGGERS set in src/auto-reply/reply/abort-primitives.ts.

    isAbortTrigger is a pure set-membership check:

    export function isAbortTrigger(text?: string): boolean {
      const normalized = normalizeAbortTriggerText(text);
      return ABORT_TRIGGERS.has(normalized);
    }

    Because abort-primitives.ts was not modified in this PR, every one of the new expect(isAbortTrigger(candidate)).toBe(true) assertions will fail immediately on pnpm test. The PR description says "This PR only adds trigger strings" but the production trigger strings were never actually added.

    To fix, all new phrases need to be added to the ABORT_TRIGGERS set in src/auto-reply/reply/abort-primitives.ts.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: src/auto-reply/reply/abort.test.ts
    Line: 251-293
    
    Comment:
    **Tests will fail — implementation not updated**
    
    All 23 newly added phrases (`"cancel"`, `"para"`, `"no lo hagas"`, `"no hagas eso"`, `"detenlo"`, `"no hagas nada"`, `"cancela"`, `"basta"`, `"no sigas"`, `"deja eso"`, `"alto"`, `"corta"`, `"abortar"`, `"avorter"`, `"interrompre"`, `"रुकिए"`, `"बंद करो"`, `"खत्म करो"`, `"बाहर निकलें"`, `"निरस्त करें"`, `"قف"`, `"إلغاء"`, `"خروج"`) are asserted to return `true` from `isAbortTrigger()`, but none of them exist in the `ABORT_TRIGGERS` set in `src/auto-reply/reply/abort-primitives.ts`.
    
    `isAbortTrigger` is a pure set-membership check:
    ```ts
    export function isAbortTrigger(text?: string): boolean {
      const normalized = normalizeAbortTriggerText(text);
      return ABORT_TRIGGERS.has(normalized);
    }
    ```
    
    Because `abort-primitives.ts` was not modified in this PR, every one of the new `expect(isAbortTrigger(candidate)).toBe(true)` assertions will fail immediately on `pnpm test`. The PR description says "This PR only adds trigger strings" but the production trigger strings were never actually added.
    
    To fix, all new phrases need to be added to the `ABORT_TRIGGERS` set in `src/auto-reply/reply/abort-primitives.ts`.
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/auto-reply/reply/abort.test.ts
Line: 251-293

Comment:
**Tests will fail — implementation not updated**

All 23 newly added phrases (`"cancel"`, `"para"`, `"no lo hagas"`, `"no hagas eso"`, `"detenlo"`, `"no hagas nada"`, `"cancela"`, `"basta"`, `"no sigas"`, `"deja eso"`, `"alto"`, `"corta"`, `"abortar"`, `"avorter"`, `"interrompre"`, `"रुकिए"`, `"बंद करो"`, `"खत्म करो"`, `"बाहर निकलें"`, `"निरस्त करें"`, `"قف"`, `"إلغاء"`, `"خروج"`) are asserted to return `true` from `isAbortTrigger()`, but none of them exist in the `ABORT_TRIGGERS` set in `src/auto-reply/reply/abort-primitives.ts`.

`isAbortTrigger` is a pure set-membership check:
```ts
export function isAbortTrigger(text?: string): boolean {
  const normalized = normalizeAbortTriggerText(text);
  return ABORT_TRIGGERS.has(normalized);
}
```

Because `abort-primitives.ts` was not modified in this PR, every one of the new `expect(isAbortTrigger(candidate)).toBe(true)` assertions will fail immediately on `pnpm test`. The PR description says "This PR only adds trigger strings" but the production trigger strings were never actually added.

To fix, all new phrases need to be added to the `ABORT_TRIGGERS` set in `src/auto-reply/reply/abort-primitives.ts`.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/auto-reply/reply/abort.test.ts
Line: 273-276

Comment:
**Trailing whitespace on Hindi string lines**

Four of the five newly added Hindi string lines have a trailing space after the comma. This will fail the `pnpm format` (Oxfmt) check that runs in the pre-commit hook.

```suggestion
      "रुकिए",
      "बंद करो",
      "खत्म करो",
      "बाहर निकलें",
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "Add additional abort phrases to tests" | Re-trigger Greptile

Comment thread src/auto-reply/reply/abort.test.ts Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant