feat(ui): customizable between-turn statusline#238
Merged
emal-avala merged 1 commit intomainfrom Apr 24, 2026
Merged
Conversation
Adds `ui.statusline` so operators can reshape the divider the REPL
draws before each prompt (after the first turn), or suppress it
entirely.
Config surface:
[ui.statusline]
enabled = true # default
template = "{model} · turn {turn} · ${cost}" # optional override
Placeholders: `{model}`, `{turn}`, `{tokens}`, `{cost}`, `{cwd}`,
`{session_id}`. Unknown placeholders pass through verbatim so a
template using a name this runtime doesn't recognize (future-compat)
degrades gracefully to visible text instead of silently dropping
the token. Literal braces escape via `{{` / `}}`.
Default behavior is unchanged: `enabled = true`, `template = None`
renders the existing `model · turn · tokens · cost` line.
`enabled = false` suppresses the divider altogether — useful for
scripted sessions where the divider adds noise to captured output.
Tests:
- Defaults round-trip from TOML
- All built-in placeholders expand
- `{{` / `}}` produce literal braces
- Unknown placeholder passed through (forwards-compat)
- Unterminated `{` preserved verbatim (no swallowing)
- Cost formatting matches built-in 4-digit precision
- No-placeholder string unchanged
- Stray `}` preserved
10 new schema tests, full suite 107 pass. Clippy clean.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Summary
Adds
ui.statuslineso operators can reshape (or suppress) the divider the REPL draws before each prompt after the first turn.Config surface
Placeholders:
{model}{turn}{tokens}{cost}{cwd}{session_id}{{/}}produce literal braces.{…is preserved verbatim so the operator can spot the typo.enabled = falsesuppresses the divider entirely — useful for scripted sessions where the divider adds noise to captured output.Defaults preserved
With no config or
enabled = true, template = Nonethe existingmodel · turn N · T tokens · $0.0000line is unchanged byte-for-byte.Tests (10 new)
Schema (3): default round-trip, TOML parse, disabled flag round-trip.
Template rendering (7):
{{/}}escape to literal braces{preserved}preservedFull schema suite: 107 pass, 0 fail. Clippy clean under
-D warnings. CLI crate builds cleanly with the repl.rs wiring.Test plan
cargo test -p agent-code-lib --lib config::schemacargo build -p agent-codecargo clippy --workspace --tests --no-deps -- -D warningscargo fmt --all --check