refactor(coding-agent): streamlined codebase by deduplicating helper logic and shims

- Consolidated duplicated inline thinking level comparisons into a unified `concreteThinkingLevel` helper.
- Enhanced legacy tool shims to respect isolated session settings and support legacy options.
- Cleaned up redundant UI render requests and extra status-line updates.
- Refactored `grep` tool shim to configure context dynamically via isolated settings.
- Disabled platform-incompatible shell shim tests on Windows environments.
This commit is contained in:
can1357
2026-07-02 02:40:08 +02:00
parent d84a54e579
commit 51684b4b1d
14 changed files with 90 additions and 67 deletions
@@ -12,7 +12,7 @@ import { getModelMatchPreferences, resolveModelRoleValue } from "../config/model
import type { Settings } from "../config/settings";
import MODEL_PRIO from "../priority.json" with { type: "json" };
import commitSystemPrompt from "../prompts/system/commit-message-system.md" with { type: "text" };
import { AUTO_THINKING, toReasoningEffort } from "../thinking";
import { concreteThinkingLevel, toReasoningEffort } from "../thinking";
const COMMIT_SYSTEM_PROMPT = prompt.render(commitSystemPrompt);
const MAX_DIFF_CHARS = 4000;
@@ -56,10 +56,7 @@ function getSmolModelCandidates(
settings,
matchPreferences,
});
addCandidate(
configuredSmol.model,
configuredSmol.thinkingLevel === AUTO_THINKING ? undefined : configuredSmol.thinkingLevel,
);
addCandidate(configuredSmol.model, concreteThinkingLevel(configuredSmol.thinkingLevel));
for (const pattern of MODEL_PRIO.smol) {
const needle = pattern.toLowerCase();