Skip to content

feat(cli): add /output-style for preset response voices#192

Merged
emal-avala merged 1 commit intomainfrom
feat/output-style
Apr 23, 2026
Merged

feat(cli): add /output-style for preset response voices#192
emal-avala merged 1 commit intomainfrom
feat/output-style

Conversation

@emal-avala
Copy link
Copy Markdown
Member

@emal-avala emal-avala commented Apr 23, 2026

Summary

Four selectable response styles, each injecting a different instruction block into the system prompt to shape the model's voice:

Style Effect
default No override (the codebase's default voice)
concise Shorter, fewer qualifiers, skip prefaces
explanatory Explain reasoning and trade-offs as you go
learning Narrate each step for users 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  (active)

Usage: /output-style <name>   (alias: /style)

Why

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

  • New enum ResponseStyle in crates/lib/src/state/mod.rsDefault, Concise, Explanatory, Learning, each with a prompt_fragment() method
  • AppState gains a response_style: ResponseStyle field (session-local, not persisted)
  • build_system_prompt emits a # Active response style block when the style is non-Default — placed before # Available Tools so it stays salient in long contexts
  • Heading is distinct from the existing static # Response style guideline block so they don't collide
  • response_style is included in the system-prompt cache hash so flipping style takes effect on the very next turn

Aliases

  • Command: /output-style, /style
  • Names: off/normaldefault, terseconcise, explainexplanatory, teach/teacherlearning

Test plan

  • cargo fmt --all — clean
  • cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo test -p agent-code-lib --lib state — 11/11 pass (6 new for ResponseStyle)
  • cargo test -p agent-code-lib --lib system_prompt — 4/4 pass (2 new)
    • system_prompt_omits_style_block_for_default
    • system_prompt_injects_non_default_style_fragment (iterates all 3 non-default styles, asserts fragment appears before # Available Tools)

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@emal-avala emal-avala force-pushed the feat/output-style branch 4 times, most recently from e57395c to 75840e0 Compare April 23, 2026 04:15
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)
@emal-avala emal-avala merged commit 16ff118 into main Apr 23, 2026
14 checks passed
@emal-avala emal-avala deleted the feat/output-style branch April 23, 2026 04:23
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