Skip to main content

Module cli_notice

Module cli_notice 

Source
Expand description

Pane notices about an agent’s CLI (SPEC_LAUNCH_CONTEXT_WORKSPACE_RULE_AND_STARTUP_FILES_2026_09_30.md §6.3, phase LC4):

  • Install: while ResolveCli npm-installs the pinned CLI for a pane, an agentmux_cli_install frame says so — installing, then installed or failed, under one install_id so the row updates in place. A pane restored at startup used to install silently.
  • Version change: each agent’s last-run CLI version is kept in RECORD_FILE, in the channel directory (record_dir). When the agent’s CLI next starts on a different version, an agentmux_cli_version_changed frame tells the user (from, to, and the version AgentMux pins).

Both are system frames appended to the pane’s output, so they replay with the transcript, and the digest never reads them (it only reads assistant/user/result lines). They are for the user; the agent’s context is unchanged.

Structs§

LastCli 🔒

Enums§

InstallState
Where an install stands.

Constants§

INSTALL_SUBTYPE
RECORD_FILE
Per-agent last-run CLI versions, in record_dir (no schema change: a new column would lock older builds out of a shared store.db).
VERSION_CHANGED_SUBTYPE

Statics§

RECORD_LOCK 🔒
Serializes read-modify-write of RECORD_FILE within this srv.

Functions§

agent_key_of_block
The key an agent’s record is kept under: the block’s agentId (the agent’s UID, or a provider key for a quick-launch pane). None for a block with no agent.
append_to_pane
Append frame to block_id’s output (and the agent’s global transcript zone), as the memory-delivery notice does.
install_frame
An agentmux_cli_install frame. install_id is the same for every frame of one install, so the pane updates one row.
observe_and_notify
Observe version for an agent and, if it changed, append the notice to block_id’s pane. The agent is agent_id when the caller knows it (a new pane resolves its CLI before its agentId meta is written), else the pane’s agentId. The one entry point both sources use: Claude’s own system/init frame, and ResolveCli for the other providers.
observe_version
Record that agent_key’s CLI just started on version, and return the version it last ran if that was a different one of the same provider. A first run, or a switch to another provider, records and returns None. A record that can’t be read or written is logged and treated as empty: at worst a notice is missed, never a launch.
record_dir
Where RECORD_FILE lives: the channel directory (~/.agentmux/channels/<channel>/, or a dev build’s own root), next to the shared store that holds the agents it is keyed by. Not data_dir: an installed build’s data dir is per AgentMux version (channels/<ch>/versions/<v>/data/), so after an upgrade every agent would read as a first run and the upgrade this exists to report would go unnoticed (ReAgent P1 on #4128).
version_changed_frame
An agentmux_cli_version_changed frame. pinned is the version this AgentMux build installs, so the pane can say when to isn’t it (a self-update, or a stale install).
version_token
The version number in a CLI’s --version output, e.g. "2.1.285" from "2.1.285 (Claude Code)" or "codex-cli 0.154.0". None if there is none ("unknown", an empty string).