Skip to content

feat(bash): add host-only /bash slash command - #722

Merged
steipete merged 2 commits into
openclaw:mainfrom
vrknetha:feat/slash-bash-command
Jan 13, 2026
Merged

steipete merged 2 commits into
openclaw:mainfrom
vrknetha:feat/slash-bash-command

Conversation

@vrknetha

@vrknetha vrknetha commented Jan 11, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds a new chat slash command for trusted operators: /bash <command>.

  • Runs a host shell command from chat without invoking the LLM (command-only; does not interfere with agent runs).
  • Long-running commands background after a configurable foreground window and can be controlled via chat.
  • Enforces one /bash job at a time (global) to keep UX simple; additional /bash <cmd> requests return "already running".

Commands

  • /bash <command>
  • /bash poll (optionally /bash poll <sessionId>)
  • /bash stop (optionally /bash stop <sessionId>)

Config / Security

  • Feature gate: commands.bash: true (default off)
  • Foreground window: commands.bashForegroundMs (0 backgrounds immediately)
  • Host execution is gated by existing elevated allowlists:
    • tools.elevated.enabled
    • tools.elevated.allowFrom.<provider>

Docs

  • Updates docs for /bash and the new config keys.

Tests

  • pnpm lint
  • pnpm test src/auto-reply/reply/commands.test.ts src/docs/slash-commands-doc.test.ts

@vrknetha vrknetha changed the title Feat/slash bash command Auto-reply: add host-only /bash slash command Jan 11, 2026
@vrknetha vrknetha changed the title Auto-reply: add host-only /bash slash command feat(bash): add host-only /bash slash command Jan 11, 2026
@steipete

Copy link
Copy Markdown
Contributor

other tools use ! to do the same - should we do that instead?

@steipete steipete added the question Further information is requested label Jan 12, 2026
@vrknetha

Copy link
Copy Markdown
Contributor Author

Hmm, we can. Let me change that

@vrknetha

Copy link
Copy Markdown
Contributor Author

Implemented the requested ! syntax for host shell chat commands.

  • ! <cmd> now runs the same handler as /bash <cmd>.
  • !poll / !stop (and /bash poll / /bash stop) are supported.
  • Docs + config help strings updated to mention the alias.

@steipete
steipete merged commit d5b17d3 into openclaw:main Jan 13, 2026
@steipete

Copy link
Copy Markdown
Contributor

Landed via temp rebase onto main.

  • Gate: pnpm lint && pnpm build && pnpm test
  • Land commit: 07cc816
  • Merge commit: d5b17d3

Thanks @vrknetha!

dustin-olenslager pushed a commit to dustin-olenslager/ironclaw-supreme that referenced this pull request Mar 24, 2026
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
feat(bash): add host-only /bash slash command
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
feat(bash): add host-only /bash slash command
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
amittell added a commit to amittell/openclaw that referenced this pull request Sep 2, 2026
…ary on final quality-audit failure

When the quality audit fails on the FINAL retry attempt (or nothing is
regenerable) the safeguard returned { cancel: true } with no fallback
summary. A context-heavy session (~300k+ tokens / ~1.1M+ chars) then can
never compact: it sits at 100% context and the next turn hits the
context-length-exceeded provider 400 path, permanently uncompactionable.

On the final failed attempt, finalize a structured fallback summary
(re-distilled from the previous summary via buildStructuredFallbackSummary,
plus the preserved recent turns) and let compaction PROCEED with a
degraded artifact. The path is logged with
reasonCode=quality_guard_degraded_fallback and the reason codes, and any
producer losses from the failed attempts are carried into the degraded
finalization so the truncation diagnostic stays attached to the artifact.

Genuinely unrecoverable paths (LLM throw, no model, no auth, corrective
generation failure) still cancel.

Tests: the two cases that pinned cancel now assert compaction proceeds
with a structured fallback summary and no cancel reason.
amittell added a commit to amittell/openclaw that referenced this pull request Sep 2, 2026
…uites

Adds the regression tests for the three compaction-safeguard tickets:

- openclaw#721: unit test asserting the missing_identifiers audit reason carries
  the full >4000-char identifier payload, and an end-to-end quality-guard
  scenario asserting every identifier survives in the corrective
  instruction sent to the model.
- openclaw#722: the two final-audit cases now assert degraded fallback behavior
  (compaction proceeds, structured fallback summary, no cancel reason,
  quality_guard_degraded_fallback log line).
- openclaw#723: unit tests for resolveCompactionSummaryBudgetChars (16k floor,
  no-maxTokens ceiling, scaled ceiling, session-size passthrough) and an
  end-to-end scenario asserting a ~1M-char serialized session finalizes
  with all required tail sections plus a 20k filler line intact and no
  truncation marker.

Also updates the test API surface: exports
wrapUntrustedQualityFeedbackBlock + resolveCompactionSummaryBudgetChars,
renames MAX_COMPACTION_SUMMARY_CHARS to the MIN_COMPACTION_SUMMARY_CHARS
floor, and threads per-section maxChars through the preserved/split-turn
section builders.
zeekay pushed a commit to Dream-AI-4444/bot that referenced this pull request Sep 11, 2026
feat(bash): add host-only /bash slash command
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
lhfer pushed a commit to lhfer/openclaw that referenced this pull request Oct 11, 2026
feat(bash): add host-only /bash slash command
amittell added a commit to amittell/openclaw that referenced this pull request Oct 28, 2026
…f upstream's merged openclaw#130393 and openclaw#138416

beta.4 carries openclaw#130393 (83b5f54) and openclaw#138416 (a5a92cd) natively,
so the fork's older revisions of both give way:

- agent-hooks/compaction-safeguard.ts: beta.4's structure (suffix helpers
  inline, request-context, upstream's fit and degrade logic). Upstream's
  degrade(...) commits a qualityDegraded summary on exhausted quality checks,
  which covers the fork's openclaw#722 terminal-branch divergence. Kept, fork-only:
  the openclaw#138415-variant feedback wrapper (wrapUntrustedQualityFeedbackBlock)
  and the SAFETY comments, including one re-worded for beta.4's
  formatNonTextPlaceholder.
- agent-hooks/compaction-suffix.ts: deleted. It was the 10.8 release line's
  module (a16ff7f); beta.4 defines CompactionLoss, with
  identifier-retention and quality-retention, in the safeguard. No importers
  remain.
- agent-core compaction.ts and compaction-details.ts: beta.4's
  (request-context.js, native qualityDegraded). Kept, fork-only: the I1
  open-tool-call cut guard (createToolCallOccurrenceQueue,
  extractToolCallsFromAssistant, extractToolResultId; same API in beta.4's
  tool-result-pairing).
- Compaction tests (summary-budget, tool-failures, safeguard, compact.hooks,
  degraded-reload, provider-boundary): beta.4's, byte-identical. beta.4's
  compact.hooks.safeguard.test-support.ts already expects "degrade". The
  fork's compact.hooks.codex-plans.test-support.ts is removed with its
  import (beta.4 defines the helper inline). The fork's 8 tool-failures tests
  give way to upstream's 74-line it.each set for the byte-identical module;
  the one behavior it does not pin is "no section for no failures".
- Docs (concepts/compaction, reference compaction, heartbeat-compaction):
  beta.4's text, which describes the native behavior.

Not built here (no builds on this host); tsgo and tests run on the M4.
amittell added a commit to amittell/openclaw that referenced this pull request Oct 28, 2026
…d-fallback test

compaction-safeguard.degraded-retention.test.ts was the 10.5 carry
(690039a) of the test upstream now ships as
compaction-safeguard.degraded-fallback.test.ts: identical it.each, a
superset of its assertions, one more case. The fork degrade-fallback
test (openclaw#722) stays; it pins retry exhaustion, an untouched passing summary,
deduped reason codes and no cancellation.

PORTING-NOTES: the qualification results so far (tsgo:all, build,
compaction suite) and the reply-preview display gap left after 84760e8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants