Sassy `mode` from config file is ignored (only CLI `--mode` works)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
Research direction
Start in shell_sage/core.py, comparing main() with get_opts() and tracing how mode is resolved from the config file. Verify that ssage with mode = sassy and no --mode uses the sassy persona, while explicit --mode behavior remains unchanged; also check the blank-mode edge case described in the issue.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Jupyter Notebook
- Stars
- 409
- Forks
- 45
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AnswerDotAI/shell_sage
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
AnswerDotAI/shell_sage#79 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
AnswerDotAI/shell_sage#103 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
AnswerDotAI/shell_sage#98 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
AnswerDotAI/shell_sage#94 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
AnswerDotAI/shell_sage#77 · 1 comment ·
All issues in AnswerDotAI/shell_sage
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
from:qa priority:P2 reliability tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
spec-kitty/spec-kitty#4874 ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/fulltextsearch#1011 ·
-
automation code-quality cookie deep-report documentation improvement quick-win task-mining
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100