feat: add show_model_in_prompt config to hide model from prompt#3340
Open
fauzan171 wants to merge 1 commit into
Open
feat: add show_model_in_prompt config to hide model from prompt#3340fauzan171 wants to merge 1 commit into
fauzan171 wants to merge 1 commit into
Conversation
Add a new configuration option that allows users to hide the model name from the shell prompt (both ZSH rprompt and interactive REPL prompt). This addresses privacy concerns where users may not want others to see which AI model they are using. When set to , both the model name and reasoning effort segments are hidden from the status line. Defaults to to preserve existing behavior. Usage in forge.toml: show_model_in_prompt = false Or via environment variable: FORGE_SHOW_MODEL_IN_PROMPT=false Closes tailcallhq#3317
|
|
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
Add a
show_model_in_promptconfiguration option that allows users to hide the model name and reasoning effort from the shell prompt (both ZSH rprompt and interactive REPL prompt).Context
Users may not want others to see which AI model they are using, especially in shared screen/pair programming environments. Currently, the model name is always displayed in the right-side prompt and cannot be disabled.
Closes #3317
Changes
show_model_in_promptboolean config field toForgeConfig(defaults totrue)ZshRPromptto conditionally render model and reasoning effort segments based on configForgePrompt(interactive REPL prompt) to conditionally render model and reasoning effort segmentstrue) in embedded.forge.tomldefaultsforge.schema.json) to include the new fieldKey Implementation Details
The
show_modelflag is threaded fromForgeConfigthrough to both prompt renderers:ZshRPrompt): Receives the flag viafrom_config()constructor, wraps both model and reasoning effort rendering in a conditional blockForgePrompt): Receives the flag via theshow_modelsetter generated byderive_setters, wraps both model and reasoning effort rendering in a conditional blockWhen
show_model_in_prompt = false, both the model name AND reasoning effort label are hidden since reasoning effort is semantically tied to the model.Use Cases
# Via environment variable FORGE_SHOW_MODEL_IN_PROMPT=false forgeThis is useful for:
Testing
All 44 prompt/rprompt tests pass including 5 new tests:
test_rprompt_hide_model- verifies model and effort hidden when disabled (active state)test_rprompt_hide_model_init_state- verifies model hidden when disabled (inactive state)test_rprompt_show_model_default_true- verifies model visible by defaulttest_render_prompt_right_hide_model- verifies REPL prompt hides model when disabledtest_render_prompt_right_show_model_default_true- verifies REPL prompt shows model by defaultLinks