Add RTK integration for token-optimized command output

When enableRtk is set in adapter config, the adapter:
- Adds an init container (curlimages/curl) to download the RTK binary
- Mounts RTK binary in the main container via shared emptyDir volume
- Runs `rtk install claude-code` before invoking Claude to set up hooks
- Disables RTK telemetry (RTK_NO_TELEMETRY=1) for automated environments
- Supports optional rtkVersion config for pinning specific versions

RTK filters CLI command output before it reaches the LLM context,
reducing token consumption by ~80%.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-04-14 01:27:28 +00:00
parent 77ba40d9bf
commit d074cb2a8c
14 changed files with 238 additions and 16 deletions
+4
View File
@@ -38,6 +38,10 @@ Kubernetes fields:
- ttlSecondsAfterFinished (number, optional): auto-cleanup delay; default 300
- retainJobs (boolean, optional): skip cleanup on completion for debugging
RTK fields (token optimization):
- enableRtk (boolean, optional): install and enable RTK to reduce token usage by filtering command output (~80% reduction). Adds an init container to download the RTK binary from GitHub.
- rtkVersion (string, optional): RTK version to install; defaults to "latest"
Operational fields:
- timeoutSec (number, optional): run timeout in seconds; 0 means no timeout
- graceSec (number, optional): additional grace before adapter gives up after Job deadline