feat(cli): add /output-style for preset response voices#192
Merged
emal-avala merged 1 commit intomainfrom Apr 23, 2026
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
e57395c to
75840e0
Compare
Four selectable response styles, each injecting a different
instruction block into the system prompt to shape the model's voice:
default no override
concise shorter, fewer qualifiers
explanatory explain reasoning and trade-offs as you go
learning narrate each step for someone new to the codebase
> /output-style learning
Response style set to 'learning'.
> /output-style
Available response styles:
default — no override (active)
concise — shorter responses, fewer qualifiers
explanatory — explain reasoning and trade-offs
learning — narrate steps for new-to-codebase users
The style fragment is injected under a "# Active response style"
heading near the top of the prompt (before the tool docs) so it
stays salient in long contexts. Heading is intentionally distinct
from the existing static "# Response style" guideline block so they
don't collide.
`response_style` participates in the system-prompt cache hash, so
flipping style takes effect on the very next turn without a manual
cache bust.
Aliases: /output-style, /style
Style aliases: off/normal (default), terse (concise),
explain (explanatory), teach/teacher (learning)
75840e0 to
9bcd3a2
Compare
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
Four selectable response styles, each injecting a different instruction block into the system prompt to shape the model's voice:
defaultconciseexplanatorylearningWhy
Different pair-programming modes want different voices. A reviewer wants terse results; an onboarding hire wants explanations; a library author wants alternative designs weighed out. Putting them on a slash command makes the switch one keystroke and session-scoped.
Implementation
ResponseStyleincrates/lib/src/state/mod.rs—Default,Concise,Explanatory,Learning, each with aprompt_fragment()methodAppStategains aresponse_style: ResponseStylefield (session-local, not persisted)build_system_promptemits a# Active response styleblock when the style is non-Default— placed before# Available Toolsso it stays salient in long contexts# Response styleguideline block so they don't collideresponse_styleis included in the system-prompt cache hash so flipping style takes effect on the very next turnAliases
/output-style,/styleoff/normal→default,terse→concise,explain→explanatory,teach/teacher→learningTest plan
cargo fmt --all— cleancargo clippy --workspace --all-targets -- -D warnings— cleancargo test -p agent-code-lib --lib state— 11/11 pass (6 new forResponseStyle)cargo test -p agent-code-lib --lib system_prompt— 4/4 pass (2 new)system_prompt_omits_style_block_for_defaultsystem_prompt_injects_non_default_style_fragment(iterates all 3 non-default styles, asserts fragment appears before# Available Tools)