Docs for SCORPIOX CODE @ e30b171

Using the /keepalive Command

Long agent sessions are expensive to interrupt. Every time you stop and come back, the model’s prompt cache may have expired, and your next message has to re-send and re-create the entire context from scratch — a slower, more expensive turn. SCORPIOX CODE’s cache keep-alive solves this: it quietly keeps your context warm while you are away, so when you return, your next message lands on a hot cache instead of a cold start.

The whole thing is driven by one built-in command — /keepalive — plus a small, draggable popup that shows exactly what is happening. There is also a /goal shortcut for the most common case: “keep my session alive, and here is what to focus on.”

The whole idea in one line: while you are idle, SCORPIOX CODE auto-sends a tiny ping through the normal conversation just before the provider’s cache expires. The ping hits the existing cache (it is the same prompt), which refreshes the timer — so your next real message is a cache hit, not a rebuild.

Why a prompt cache expires in the first place

Most hosted model providers do not keep your full context on a hot shelf forever. They cache it for a short window (on the order of a few minutes) to save themselves cost. While the window is open, follow-up turns are cheap and fast because the provider reads the cached prefix instead of re-processing it.

The moment the window closes, the next turn pays the full price again. For a short task that does not matter. For a long session where you step away — to review something, take a call, or run a build in parallel — it does. You lose the exact speed and cost you were enjoying.

Keep-alive is the fix: instead of letting the window lapse, SCORPIOX CODE nudges the conversation right before it does. Because the nudge is a normal message with the same prompt, it is served from the cache (a cache read) and, in doing so, resets the expiry clock. Your context stays warm for as long as you want it to.

What a keep-alive ping actually is

It is not a background process and not a webhook. It is a real user message sent through the same agent path you use for everything else — same provider settings, same tools, same model. The only difference is that the timer typed it for you. That has two consequences worth knowing:

The timer itself is deliberately passive: it only watches the clock and raises a flag. The main loop picks that flag up and sends the ping only when the agent is genuinely idle — never in the middle of a turn or on top of another request. The timer never touches your conversation directly.

The /keepalive command

Type /keepalive and press Tab to see the available subcommands and a couple of example durations. On its own, /keepalive toggles the status popup. With arguments, it controls behavior:

CommandWhat it does
/keepaliveToggle the popup (show / hide). No setting changes.
/keepalive onTurn keep-alive on — or resume it if it had paused.
/keepalive offPause keep-alive. The context will be allowed to lapse.
/keepalive enableStart the background timer from a clean state (statistics reset).
/keepalive disableStop the background timer entirely.
/keepalive showShow the popup.
/keepalive hideHide the popup.
/keepalive interval <duration>Set how often it pings — e.g. 5m, 270s, 1h.
/keepalive message <text>Set the text of the ping.
/keepalive <duration>Keep the cache alive for a total duration — e.g. 45m, 2h, 1h30m. The ping count is computed for you.

Durations accept the same compact forms throughout: 90 (a bare number means seconds), 270s, 5m, 2h, or a mix like 1h30m.

enable / disable versus on / off

The four verbs do subtly different things, and choosing the right one matters:

For day-to-day use, reach for on and off.

A practical example

You are deep in a refactor and need to step away for an hour, but you want the session to be ready the instant you are back. Keep the interval at the default (~4:30) and just set a total:

/keepalive 1h

SCORPIOX CODE works out how many pings fit in that window at the current interval and caps the ping count accordingly. If no cache exists yet, it arms in idle and starts automatically on the first cached response, and the chat line tells you so:

Keep-alive for 1h (14 pings every 270s). Armed - starts after your next message creates a cache.

At the default 270-second interval, the windows map to ping counts like this:

CommandWindowPings armed
/keepalive 45m2700 s10
/keepalive 1h3600 s14
/keepalive 1h30m5400 s20
/keepalive 2h7200 s27

Changing the interval

/keepalive interval 5m
/keepalive interval 270s

Sets how long you can stay idle before a ping fires. The value is a duration in the same format as the total-duration argument. Setting it also arms and activates keep-alive, and resets the countdown from that point.

Changing the ping message

/keepalive message do nothing

Sets the text sent as each ping. Because the message travels through the normal agent path, keep it short and unambiguous — something the model can answer in a word without kicking off a long turn. The built-in default, keepalive, respond ok, is a good template.

The /goal shortcut

/goal is a one-word alias for setting the keep-alive message, with a convenience twist: if keep-alive is off, it turns itself on.

/goal keep the API tests green

This sets the ping text to “keep the API tests green” and enables keep-alive if it was disabled. The popup opens to confirm the new message.

With no argument, /goal just prints the current message:

/goal

Use /goal when you want the ping to double as a reminder of what to focus on; use /keepalive message <text> when you only want to change the text.

The keep-alive popup

Type /keepalive (no args) or /keepalive show to open the popup. It is a small card (40 columns by 9 rows) that opens in the top-right corner by default and shows the live state of the feature:

 Keep-Alive (active)                          [X]
--------------------------------------------------
 Interval:   4m 30s
 Next ping:  2m 15s
 Pings:      3 / 20
 Hits:       3    Misses: 0
 Max tries:  1 (streak: 0)
 Message:    keepalive, respond ok
FieldMeaning
Title stateOne of disabled, idle, active, pinging, or paused. The title’s colour tracks it: green for active, grey for disabled/idle, orange for paused, violet while sending.
IntervalThe configured ping interval, in human-readable form.
Next pingA live countdown to the next ping while active; sending... while a ping is in flight; -- when no ping is pending.
PingsPings sent in the current window, against the cap (when a cap is set).
Hits / MissesPings that actually read from the cache, versus pings that came back cold.
Max triesThe consecutive-miss threshold, with the current streak in parentheses.
MessageThe text that will be sent as the next ping.

Drag the popup anywhere by its title bar (click and hold the coloured header row, move, release). Click [X] or type /keepalive hide to dismiss it — hiding the popup does not touch the timer; keep-alive keeps pinging in the background.

A healthy session sits in active with a steadily counting-down Next ping and a growing Hits count. If you start to see Misses, the cache is not surviving between pings — the provider window is shorter than your interval, or the session was interrupted — and the feature will pause itself after the configured number of consecutive misses rather than keep spending on pings that are not helping.

The status-bar indicator

You do not need the popup to keep an eye on things. The status bar carries a compact, colour-coded block on the bottom-right:

MarkerMeaning
KAActive, no pings sent yet.
KA:nActive, with n pings sent so far.
KA*A ping is in flight.
KA-Armed and idle, waiting for the first cache.
KA||Paused.
(blank)Disabled.

Both fields sit at fixed positions, so the block never slides around as the values change.

Configuration keys

Keep-alive is configured through scorpiox-env.txt — any cascade tier, a named profile, or an OS environment variable. See Configuration and Profiles for the cascade and precedence rules. Command-line changes made with /keepalive or /goal take effect for the current session; these keys set the defaults it starts from.

KeyTypeDefaultDescription
CACHE_KEEPALIVEbool0 (off)Master switch. 0 = keep-alive starts disabled and you turn it on with /keepalive on; 1 = armed at startup.
CACHE_KEEPALIVE_TRIGGERint (seconds)270Seconds of idle before a ping is sent. The default, 4:30, sits 30 seconds inside a typical 5:00 cache TTL.
CACHE_KEEPALIVE_MAX_TRIESint1Consecutive cache-miss pings tolerated before the feature pauses itself.
CACHE_KEEPALIVE_MAX_PINGSint2Maximum total pings before it stops on its own. 0 means unlimited. A /keepalive <duration> command overwrites this to fit the window.

Gotchas