Skip to content

v0.12.9 — RTK Token Optimization (−80%)

Choose a tag to compare

@DusanCar-sudo DusanCar-sudo released this 29 Jul 06:42
· 79 commits to master since this release

Supersedes v0.13.1, which was tagged earlier the same day and withdrawn —
see "Reverted" below. This release is v0.13.1 minus the REPL mode switch: the
RTK token work and the Telegram search verb, nothing else.

Reverted

  • :gazelle / :coder in the plain REPL is withdrawn. Shipped in v0.13.1;
    pulled after a coder-mode task looped on one step ("Writing the HTML
    structure…" repeated until it hit the token ceiling, ending after 7 turns).
    The mode branch is inert while replMode === 'coder' and the coder path was
    unchanged beneath it, so the loop is probably not from this — but a release is
    not the place to find out. :coder and :gazelle again work only inside a
    session started with --gazelle; in the plain REPL they are unhandled and get
    sent to the model as a task, as before. Under investigation; RTK's compression
    of run_shell output is the first suspect, since a model that cannot see
    whether a write landed will retry it.

Changed

  • Shell and git tool output now goes through RTK — 80% fewer input tokens per
    session.
    RTK was installed on the machine, but its Claude hook only rewrites
    commands typed at a terminal. Aura's own tools shell out through Node's
    exec/execSync directly, so run_shell, the git tool, and the Telegram
    bot's execShell bypassed the proxy entirely: raw git diff, git log and
    grep output landed in the context window uncompressed, and the bloat
    compounded as a session grew. Each of those call sites now prefixes rtk
    (skipped when the command already starts with it), and gitStatus/gitDiff
    invoke rtk git … explicitly.

    Measured over the same three tasks — an uncommitted-changes review, a
    TypeScript compiler-API audit, and a changelog web page build — run four times
    as the patches went in:

    Run State Input tokens Turns Tool calls
    1 no RTK (raw node exec) 1,286,806 40 60
    2 telegram-bot.ts patched 946,293 39 70
    3 tools.ts patched 397,519 16 28
    4 fully optimized 253,039 13 23

    80.3% fewer input tokens and 67.5% fewer turns for identical work. Compressed
    summaries don't just cost less than raw terminal noise — the model converges
    faster on them. Full write-up in rtk-optimization-report.md.

    RTK stays optional. Prefixing unconditionally would have made it a hard
    runtime dependency of a published package — every run_shell call on a machine
    without it returning "rtk: command not found". util/rtk.ts probes PATH once
    per process (a filesystem scan, no which subprocess) and passes the bare
    command through when RTK isn't there. AURA_RTK=0 forces the raw command even
    when it is installed, which is what you want when checking exactly what a tool
    ran; AURA_RTK=1 skips the probe.

Added

  • SEARCH: for the Telegram bot. The bot could run shell commands, send
    files and take webcam stills, but had no way to look anything up — so it
    answered questions about current events from stale weights, or claimed it
    could not search at all. SEARCH: <query> now hits DuckDuckGo's lite HTML
    endpoint (no API key, no SDK) and returns the top five titles, URLs and
    snippets. The action prompt tells the agent to reach for it first when it
    lacks up-to-date information, and the "never claim you cannot…" instruction
    now covers searching alongside sending and photographing.