Skip to content

fix: gate Telegram exec tool warnings behind verbose mode#20560

Merged
obviyus merged 2 commits into
mainfrom
fix/19912-telegram-exec-warning-verbose
Feb 19, 2026
Merged

fix: gate Telegram exec tool warnings behind verbose mode#20560
obviyus merged 2 commits into
mainfrom
fix/19912-telegram-exec-warning-verbose

Conversation

@obviyus

@obviyus obviyus commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Problem: Telegram users can see raw exec tool failure warnings (including command context) during normal runs.
  • Why it matters: leaks internal tool details into end-user chats; noisy and unsafe by default.
  • What changed: gate exec/bash tool-error warnings behind verbose mode (on|full) and ignore non-error status values like 0/ok/completed/running when extracting tool error text.
  • What did NOT change (scope boundary): non-exec mutating warnings (e.g. write) still surface as before.

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

User-visible / Behavior Changes

  • Default (verbose=off): exec/bash failure warnings are suppressed from user-visible payloads.
  • Verbose (verbose=on|full): exec/bash failure warnings remain visible.
  • Tool error extraction no longer treats success-like status values (0, ok, completed, running) as error text.

Security Impact (required)

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

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: local dev
  • Model/provider: n/a (unit tests)
  • Integration/channel (if any): Telegram dispatch path covered by tests
  • Relevant config (redacted): verbose mode off vs on

Steps

  1. Build payloads with lastToolError.toolName="exec", verbose off.
  2. Build payloads with same error, verbose on.
  3. Extract error message from { details: { status: "0" } } and from { details: { status: "failed" } }.

Expected

  • Step 1: no user-facing warning payload.
  • Step 2: warning payload exists.
  • Step 3: "0" ignored, "failed" preserved.

Actual

  • Matches expected in added tests.

Evidence

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

Human Verification (required)

  • Verified scenarios: new unit tests + existing Telegram dispatch test.
  • Edge cases checked: non-exec mutating warning (write) still visible; status-based false-positive error text removed.
  • What you did not verify: live Telegram end-to-end against a real bot token.

Compatibility / Migration

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

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: revert this PR commit.
  • Files/config to restore: src/agents/pi-embedded-runner/run/payloads.ts, src/agents/pi-embedded-subscribe.tools.ts.
  • Known bad symptoms reviewers should watch for: missing exec warnings in verbose mode (regression), or failed: 0 style warnings returning.

Risks and Mitigations

  • Risk: users may miss exec failures in non-verbose mode if assistant text is empty.
    • Mitigation: behavior remains explicit in verbose mode; non-exec mutating tool warnings unchanged.

Greptile Summary

Gated exec/bash tool warnings behind verbose mode to prevent leaking internal command details to Telegram users, while filtering out false-positive error statuses like 0 or completed.

Key changes:

  • exec and bash tool errors now suppressed in default mode, visible only when verbose=on|full
  • Non-exec mutating tools (e.g. write) continue showing warnings regardless of verbose mode
  • Status values like 0, ok, success, completed, running no longer treated as errors
  • Comprehensive test coverage added for both gating logic and status filtering

Confidence Score: 5/5

  • Safe to merge with no significant risks
  • Well-scoped bug fix with thorough test coverage, clear behavioral boundaries, and no breaking changes. Logic correctly distinguishes between exec/bash tools (gated) and other mutating tools (always visible), with proper status filtering to avoid false positives.
  • No files require special attention

Last reviewed commit: a68b696

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Feb 19, 2026
@obviyus obviyus self-assigned this Feb 19, 2026
@obviyus obviyus force-pushed the fix/19912-telegram-exec-warning-verbose branch from a68b696 to 27ac038 Compare February 19, 2026 03:27
@obviyus obviyus force-pushed the fix/19912-telegram-exec-warning-verbose branch from 27ac038 to 7ce9493 Compare February 19, 2026 03:34
@obviyus obviyus merged commit 6b05916 into main Feb 19, 2026
19 checks passed
@obviyus obviyus deleted the fix/19912-telegram-exec-warning-verbose branch February 19, 2026 03:35
@obviyus

obviyus commented Feb 19, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

xinhuagu added a commit to xinhuagu/openclaw that referenced this pull request Feb 19, 2026
…sion

Add test cases for the exact scenario described in openclaw#17837: exec tool
fails but agent falls back to an alternative tool and produces a
correct answer. The exec failure notification should not surface to
the user in Telegram.

The underlying fix was implemented in openclaw#20560 (gating exec/bash warnings
behind verbose mode). These tests verify the fallback scenario
specifically.

Closes openclaw#17837
mmyyfirstb pushed a commit to mmyyfirstb/openclaw that referenced this pull request Feb 21, 2026
…0560)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 7ce9493
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 1, 2026
…0560)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 7ce9493
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus

(cherry picked from commit 6b05916)

# Conflicts:
#	CHANGELOG.md
#	src/agents/pi-embedded-runner/run/payloads.test.ts
#	src/agents/pi-embedded-runner/run/payloads.ts
#	src/agents/pi-embedded-subscribe.tools.test.ts
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
…0560)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 7ce9493
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus

(cherry picked from commit 6b05916)

# Conflicts:
#	CHANGELOG.md
#	src/agents/pi-embedded-runner/run/payloads.test.ts
#	src/agents/pi-embedded-runner/run/payloads.ts
#	src/agents/pi-embedded-subscribe.tools.test.ts
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
…0560)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 7ce9493
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
…0560)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 7ce9493
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…0560)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 7ce9493
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telegram: Exec tool output leaks to chat during active agent turn (streamMode partial preview)

1 participant