fix(deepseek): the dsh footer field after a switched-off model is not the model

dsh-TUI draws the model as its status line's first field only while the
status bar's model field is on (the default). Switched off, the first field
is the reasoning effort (` medium · th-scratch`), else the mode, else the
cwd's basename, and the footer pattern read that as the model, which would
also outrank the route config added in the previous commit.

The captured field must now carry a digit, as a model id does (a version) and
an effort word, a mode name or most folder names do not. A model id without
one (`deepseek-chat`) is not read from the screen and the session falls back
to its route config: silent, never wrong.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer
2026-10-07 19:54:17 +02:00
parent 661fe3dc13
commit 21ae48a5c8
2 changed files with 17 additions and 1 deletions
+10
View File
@@ -127,6 +127,16 @@ describe('readScreenModel', () => {
);
});
it("never reads the field after a switched-off model as the model (dsh's effort, mode, cwd)", () => {
// dsh-TUI with `statusBar.model: false`: the effort word comes first.
expect(readScreenModel(dshPane(' medium · th-scratch'), DSH, DSH_ROWS)).toBeUndefined();
expect(readScreenModel(dshPane(' xhigh · plan · th-scratch'), DSH, DSH_ROWS)).toBeUndefined();
expect(readScreenModel(dshPane(' th-scratch'), DSH, DSH_ROWS)).toBeUndefined();
// A model id carries a version digit; one that does not is left to the config.
expect(readScreenModel(dshPane(' deepseek-v4-flash · max · th-scratch'), DSH, DSH_ROWS)).toBe('deepseek-v4-flash');
expect(readScreenModel(dshPane(' deepseek-chat · max'), DSH, DSH_ROWS)).toBeUndefined();
});
it("reads codex's model off its status line (0.147.0 and 0.154.0 layouts)", () => {
expect(readScreenModel(CODEX_LIVE, CODEX, CODEX_ROWS)).toBe('gpt-5.6-terra');
expect(readScreenModel(CODEX_154, CODEX, CODEX_ROWS)).toBe('gpt-5.6-sol');