Skip to content

feat(statusline): model and identity segments - #538

Merged
Mearman merged 5 commits into
mainfrom
feat/statusline-identity
Oct 20, 2026
Merged

Mearman merged 5 commits into
mainfrom
feat/statusline-identity

Conversation

@Mearman

@Mearman Mearman commented Oct 19, 2026

Copy link
Copy Markdown
Member

Adds the model and identity part of claude-hud parity to the built-in statusline. The header gains four segments, effort, advisor, version and outputStyle, which are in the schema's list and the registry but not in the default layout.header, so the default line is unchanged. Per-element groups hold the options: model (format, override, source), provider.name, account (which parts to write and how much of the email), effort.format and advisor.override. claude-hud's show* booleans are membership of the header list, as the earlier groups do it.

The existing account segment already draws the login's email, organisation and plan, so showAuth and showAuthUser are the plan and user parts of it (account.parts) rather than a second auth segment. account.userLength cuts the whole email where claude-hud cuts its local part. The parity map and document record both differences, along with the ones that follow from agent-shim being the launcher: no environment-based Bedrock or Vertex provider label, and no API Key plan from an ambient key.

model.source and the advisor need the transcript. Elements may not read the machine directly, so the ports gain readTail, which returns the end of a file from a line boundary, and the render context carries a memoised transcriptTail so the model and advisor segments cost one bounded read between them however long the session. The window is a named constant and the parser skips a record that is not whole, since a transcript being appended to can end mid-line. The cost of that choice is that claude-hud's ultracode(<level>) is not drawn: it comes from /effort wording that can be far outside any bounded window, so showing it would sometimes be wrong. The version comes from the payload's version field instead of running claude --version, and the output style is read from the four settings files in claude-hud's order through ports.readText.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ⚠️ Failed 2026-10-19T21:37:52.195715Z 4d5d459 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

A session transcript grows for as long as the session runs, so an element that wants its latest
records cannot afford `readText` on every refresh. `readTail` returns the last bytes of a file
starting at a line boundary, dropping the partial line a cut lands in, so the cost of a refresh is a
fixed number of bytes however long the file is.
The header gains effort, advisor, version and outputStyle segments, listed in the schema and the
registry but not in the default layout, so the default line is unchanged. New setting groups cover
the model name (format, override, source), the provider label, which parts of the account the
account segment writes and how much of the email, the effort format and the advisor override.

The model source and the advisor read the end of the session transcript through a window of fixed
size, once per render however many elements want it, and skip a record cut short by a read of a
transcript that is still being written. The version comes from the client's payload, the effort from
its string or object form, and the output style from the settings files in the order the client
applies them. Text that comes from outside the statusline loses its control and format characters
and is cut by grapheme.

The claude-hud parity map and document account for the display, segment and model keys of this
group, including where agent-shim differs.
@Mearman
Mearman force-pushed the feat/statusline-identity branch from 4d5d459 to 6256b49 Compare October 19, 2026 21:48
…script backwards

Reading a fixed window of the transcript's end lost the model and the advisor whenever the newest
assistant record, or a line after it, was larger than the window. The reader now takes a chunk at a
time from the end, joins a line that spans chunks before parsing it, and stops at the newest
assistant record, so the cost follows how far back that record is, within a fixed read budget. The
file port becomes a range read that also reports the file's size, which keeps a cut that lands
exactly on a line boundary from losing that line.

Records Claude Code wrote itself, marked `<synthetic>`, are skipped, so an API error or an
interrupt no longer replaces the served model. The advisor is taken from the same record. The effort
level and the version are cleaned like other text from outside the statusline, and a level named
after an inherited object property is no longer looked up as a symbol.
…he model and advisor

The earlier test put its multi-byte characters in padding after the names, where decoding each
chunk separately still parsed. The names now hold the characters and the file is sized so the first
chunk edge falls inside one, which fails when the pieces of a line are decoded before they are
joined. FileRange is exported from the ports and the real readRange matches its sibling
declaration.
…ctory correctly

A dated model id with no minor version, such as claude-opus-4-20250514, was written with its date
as the minor version. The id is now read in either naming, family first or version first, with a
minor of at most two digits and an optional release date that is dropped.

An empty CLAUDE_CONFIG_DIR is treated as unset, as the launcher treats it, instead of putting the
settings files in the working directory. The multi-byte test now also cuts a chunk edge inside a
record that follows another line, which exercises the join of a line spanning chunks and not only
the file's first line.
@Mearman
Mearman merged commit 08ee49d into main Oct 20, 2026
31 checks passed
@Mearman
Mearman deleted the feat/statusline-identity branch October 20, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant