Sassy `mode` from config file is ignored (only CLI `--mode` works)
评估
调研方向
从 shell_sage/core.py 开始,将 main() 与 get_opts() 进行比较,并跟踪 mode 如何从配置文件中解析。验证在 mode = sassy 且未使用 --mode 的情况下,ssage 使用 sassy persona,同时显式指定 --mode 时的行为保持不变;还要检查 issue 中描述的空 mode 边界情况。
由索引模型根据 Issue 内容生成。
描述
When mode is set in the shell_sage config file (~/.config/shell_sage/shell_sage.conf), ShellSage still starts in default mode. The --mode sassy CLI flag works correctly, but the config value is never picked up.
Steps to reproduce
- Set
mode = sassyin~/.config/shell_sage/shell_sage.conf - Run
ssage "Say hello in one sentence"(no--modeflag) - Observe the response
Expected behavior
With mode = sassy in the config, ssage should respond in sassy mode (GLaDOS-style persona).
Actual behavior
ssage responds in the default teaching-assistant persona:
Hello! I'm ShellSage, your command-line teaching assistant — what shell task can I help you with today?
Running ssage --mode sassy "Say hello in one sentence" does produce the sassy persona, confirming the flag path works:
Hello, test subject — congratulations on successfully typing a query; I do hope that wasn't the most challenging part of your day.
Root cause
In shell_sage/core.py, main() never routes mode through get_opts(), which is where config-file values are resolved:
main()'smodeparameter defaults to'default'rather thanNone- The
get_opts(...)call does not passmode=mode get_optsonly fills a value from the config when the passed value isNone(if v is None: opts[k] = cfg.get(k, default_cfg.get(k)))
So the config value for mode is never read.
Proposed fix (verified working locally)
- Change the
modeparameter default toNone - Pass
mode=modetoget_opts(...) - Use
opts.modefor validation and theget_sage(...)call
Related edge case
If the config contains a blank mode = (e.g. from a generated config), opts.mode becomes '' and validation fails with is not valid. Must be one of: ['default', 'sassy']. Consider normalizing empty to default (opts.mode = opts.mode or 'default').
Environment
- Host: solveit (hosted notebook environment), Linux container
- Python 3.12
- shell-sage 1.0.9, installed editable from a git clone into an isolated venv (
/app/data/aai-venv) — the system site-packages also has a stale shell-sage 1.0.9 which shadows the editable install for the defaultssagebinary - Tested in a detached tmux session (via the
fastmuxpyskill) to givessagea real TTY - Config file:
~/.config/shell_sage/shell_sage.confwithmode = sassy,vendor_name = deepseek,model = deepseek-v4-flash
Dependency notes (may be relevant to maintainers)
- The repo's
pyproject.tomlrequirespython-fastllm>=0.0.38, but the system environment had fastllm 0.0.36 (noStreamAccum) — one reason testing was done in a venv - The venv installed from local clones:
python-fastllm0.0.41 (editable, from/app/data/git/fastllm)fastcore2.2.11 (editable, from/app/data/git/fastcore)aidialog0.0.19,fastspec0.2.0 (satisfied via the fastllm install)shell-sage1.0.9 (editable, from/app/data/git/shell_sage)
- Because solveit itself imports
fastcore/aidialog/fastllm, packages were deliberately not installed into the system environment — only into the isolated venv
- 主要语言
- Jupyter Notebook
- 星标
- 409
- 派生
- 44
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
AnswerDotAI/shell_sage 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
AnswerDotAI/shell_sage#79 ·
-
难度 4/5 3-5 天 新手友好度 35/100
AnswerDotAI/shell_sage#103 ·
-
难度 3/5 1-2 天 新手友好度 48/100
AnswerDotAI/shell_sage#98 ·
-
Add terminal history capture for Ghostty可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 3/5 1-2 天 新手友好度 55/100
AnswerDotAI/shell_sage#94 ·
-
难度 3/5 1-2 天 新手友好度 35/100
AnswerDotAI/shell_sage#77 · 1 条评论 ·
查看 AnswerDotAI/shell_sage 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
zilliztech/memsearch#818 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
ehmpathy/rhachet-roles-bhuild#616 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
📘 Docs supabase/cli
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
bug(cli): theme file home-directory check uses startsWith (sibling dirs pass, Windows casing fails)未关闭area/core kind/bug priority/p2 status/bot-triaged
难度 2/5 1-3 小时 新手友好度 79/100
google-gemini/gemini-cli#29955 · 2 条评论 ·
维护者通常 1 天内回复