diff --git a/src/config/cli-registry/stock.ts b/src/config/cli-registry/stock.ts index caa73a03..6a0a9c3a 100644 --- a/src/config/cli-registry/stock.ts +++ b/src/config/cli-registry/stock.ts @@ -1240,8 +1240,14 @@ const DEEPSEEK: CliEntry = { // and, on the row right under its bottom border, ` qwen3.8-27b · medium · `. // The border anchors it: nothing the agent writes can sit below the composer, and a // suggestion popup there starts with `/` or `+`, never a model id. + // ⚠ The first field is the model only while the status bar's model field is on (the + // default). Switched off, the first field is the next one: the reasoning effort + // (` medium · th-scratch`), else the mode, else the cwd's basename. So the field must + // carry a digit, which 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, + // and the session falls back to its route config: silent, never wrong. modelDetect: { - screenLine: String.raw`╰─+╯\n ?([A-Za-z0-9][\w.:/@+-]{0,79})(?= · |\n|$)`, + screenLine: String.raw`╰─+╯\n ?((?=[\w.:/@+-]*\d)[A-Za-z0-9][\w.:/@+-]{0,79})(?= · |\n|$)`, screenLines: 3, // With the status bar's model field off (or before it paints), the route the // session's profile pins, read the way dsh-TUI resolves it: src/deepseek-route-config.ts. diff --git a/test/session-display-model.test.ts b/test/session-display-model.test.ts index 3421c189..13b4613c 100644 --- a/test/session-display-model.test.ts +++ b/test/session-display-model.test.ts @@ -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');