Skip to main content

Module cli_version

Module cli_version 

Source
Expand description

The version a CLI reports for --version, asked once per CLI file instead of once per call.

ResolveCli runs for every agent that opens (and resumes), and each run spawned <cli> --version: a node process that takes 270-300 ms of CPU when the machine is idle (Area54, claude --version, warm; 3.2 s the first time) and more than the 5 s timeout when it isn’t. Resuming a window of agents on a saturated machine spawned them all at once, most timed out (“get_cli_version timed out after 5s”, narko 0.60.6), and every agent waited on its own probe before it could start. A CLI’s version only changes when its file does.

Structs§

Key 🔒
One CLI file as it is now: when it is replaced, it is a different key.
Slot 🔒

Constants§

RETRY_AFTER_FAILURE 🔒
A probe that failed (timed out, exited non-zero) is not repeated for this long: the callers that queued behind it share its answer instead of each timing out in turn.
TTL 🔒
A read version is asked for again after this long, in case the file changed without its modified time or size (an in-place update of a shim).
UNKNOWN 🔒
What a version that couldn’t be read reads as.

Statics§

SLOTS 🔒

Functions§

cached_version 🔒
The version of the CLI at cli_path: cached while the file is unchanged, and asked for by one probe at a time (callers for the same file wait for it). probe returns None when it couldn’t read one; that answers UNKNOWN and is never cached. A path with no file behind it (a bare command name) is probed every time.