mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-09 08:59:40 +02:00
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:
@@ -1240,8 +1240,14 @@ const DEEPSEEK: CliEntry = {
|
|||||||
// and, on the row right under its bottom border, ` qwen3.8-27b · medium · <cwd>`.
|
// and, on the row right under its bottom border, ` qwen3.8-27b · medium · <cwd>`.
|
||||||
// The border anchors it: nothing the agent writes can sit below the composer, and a
|
// 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.
|
// 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: {
|
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,
|
screenLines: 3,
|
||||||
// With the status bar's model field off (or before it paints), the route the
|
// 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.
|
// session's profile pins, read the way dsh-TUI resolves it: src/deepseek-route-config.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)", () => {
|
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_LIVE, CODEX, CODEX_ROWS)).toBe('gpt-5.6-terra');
|
||||||
expect(readScreenModel(CODEX_154, CODEX, CODEX_ROWS)).toBe('gpt-5.6-sol');
|
expect(readScreenModel(CODEX_154, CODEX, CODEX_ROWS)).toBe('gpt-5.6-sol');
|
||||||
|
|||||||
Reference in New Issue
Block a user