e4e9eb0928becfa4e48484dde85ef5032671d582
1
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
2ab2f69132 |
agent: Codex's status line shows the account's quota or the relay's balance (opt-in)
lyj1115 on X asked for the current account's quota, or the relay key's
balance, under Codex's chat box, off by default. Codex's TUI draws its
footer from a status line provider from 0.171.0-alpha.12 on: a stdio
MCP server whose tool advertises a statusline entrypoint, picked in
[tui] status_line_provider behind [features] tui_extensions_statusline.
Codex reads it about once a second with the thread's id. Nothing is put
into the prompt or the model's reply.
- `magpie statusline --codex` is that server. Each read asks the local
gateway for the thread's latest route and the kept quotas (no vendor
read). It answers `→ provider/model` and that provider's account that
answered last, with its windows or a key's balance. A gateway that is
down gives a null tree, never an error, because an error stops Codex's
reads. The tool's name and words name neither magpie nor a vendor,
since the tool is listed to the model.
- A status line square on Codex's row (`magpie codex statusline on`)
writes the flag, [mcp_servers.quota_line] (this magpie by full path,
args statusline --codex, env_vars = ["MAGPIE_ADDR"]) and the
provider. Every write is read back, and the file is restored on a
mismatch. Off and Disconnect take out only magpie's keys, and the flag
only when the stash says magpie wrote it.
- Nothing of the user's is written over. A provider of their own, a
quota_line of theirs, the flag turned off or an unreadable file keeps
the square away and refuses on.
- The switch is offered only when a Codex CLI here is 0.171.0-alpha.12
or newer (0.170.0 reads the keys and draws nothing), and only on this
computer, not in a WSL distro.
- In the GUI, the status line square's title takes the note of its
field's on option, which Claude Code's field already sent with the
same words TOGGLES kept, so Codex's says its own words in en, zh,
zh-TW, ja and de. TOGGLES' copy of Claude's note went, and app.js
stays under its budget (30 bytes of room) without a raise.
The Codex desktop app has no such footer. cockpit-tools reaches it
through a debug port, and magpie doesn't.
Run (WSL magpie-desktop, since mote's load was over 18):
- go vet -tags nogui ./...; GOOS=windows go vet of agent, cli, provider
and gui; gofmt -l clean.
- go test -tags nogui of ./internal/cli and ./internal/provider: ok.
- ./internal/agent -run "CodexStatus|Statusline|StatusLine|TestCodex|
TestWSLCodex": ok.
- ./internal/gui -run "CoreScript|Budget|I18n|Keys" and node --test of
codex-statusline, claude-statusline and i18n-keys (both engines, every
language, window and panel), with vet (and GOOS=linux and windows
vet) of agent, cli, provider and gui, on mote at the rebased head
(on
|