Repository navigation
feat(statusline): model and identity segments - #538
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
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
force-pushed
the
feat/statusline-identity
branch
from
October 19, 2026 21:48
4d5d459 to
6256b49
Compare
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the model and identity part of claude-hud parity to the built-in statusline. The header gains four segments,
effort,advisor,versionandoutputStyle, which are in the schema's list and the registry but not in the defaultlayout.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.formatandadvisor.override. claude-hud'sshow*booleans are membership of the header list, as the earlier groups do it.The existing
accountsegment already draws the login's email, organisation and plan, soshowAuthandshowAuthUserare theplananduserparts of it (account.parts) rather than a second auth segment.account.userLengthcuts 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 noAPI Keyplan from an ambient key.model.sourceand the advisor need the transcript. Elements may not read the machine directly, so the ports gainreadTail, which returns the end of a file from a line boundary, and the render context carries a memoisedtranscriptTailso 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'sultracode(<level>)is not drawn: it comes from/effortwording that can be far outside any bounded window, so showing it would sometimes be wrong. The version comes from the payload'sversionfield instead of runningclaude --version, and the output style is read from the four settings files in claude-hud's order throughports.readText.