rtk-ai/rtk

rtk not working in a sandboxed agent environment in Openclaw

Open

#1.780 geöffnet am 8. Mai 2026

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Rust (2.914 Forks)batch import
area:clibughelp wantedpriority:high

Repository-Metriken

Stars
 (48.085 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 11T 1h) (45 gemergte PRs in 30 T)

Beschreibung

I'm trying to get rtk working inside a sandboxed multi-agent setup in Openclaw (agents running in Docker containers) but no command inside containers are using rtk.

Setup

  • rtk 0.38.0 (Homebrew, macOS aarch64)
  • Using the openclaw plugin shipped at rtk-ai/rtk/openclaw/
  • Each agent runs inside openclaw-sandbox-common:bookworm-slim

What I'm seeing

The plugin installs cleanly and openclaw reports it's loaded with the hook registered:

$ openclaw plugins inspect rtk-rewrite
Status: loaded
Typed hooks: before_tool_call (priority 10)

But agents keep running raw git, npm, etc. No rewrites are taking effect, and rtk gain shows no tracking data either on the host or inside the agent containers.

I noticed rtk rewrite seems to exit with status 3 on successful rewrites:

$ rtk rewrite "git status"; echo "EXIT:$?"
rtk git statusEXIT:3

$ rtk rewrite "echo hello"; echo "EXIT:$?"
EXIT:1

The --help text says it should exit 0 on success and 1 when there's no equivalent:

Exits 0 and prints the rewritten command if supported.
Exits 1 with no output if the command has no RTK equivalent.

So I might be misreading something or doing something wrong. The reason this caught my eye is the openclaw plugin uses execSync(...) to invoke rtk rewrite, and Node's execSync throws on any non-zero exit, so the rewrite output gets discarded in the catch block. The shell-hook example in --help (REWRITTEN=$(rtk rewrite "$CMD") || exit 0) seems like it'd hit the same thing, since || fires on any non-zero status.

Questions

1- Have this plugin been tested with sandboxes enabled in Openclaw? If so, I might be missing some configuration. 2- Is exit 3 expected behavior I should be working around on my end (e.g. specific to my version, or carrying additional meaning), or again, is there a config / install step I'm missing for the sandbox setup?

Happy to share more details or try anything you suggest.

Thanks in advance.

Contributor Guide