feat: Display default model in dropdowns and consolidate Git settings menu (#135)

* types: add commitMessageModel to DesktopSettings

* store: add commitMessageModel state and fetch logic

* lib: implement persistence for commitMessageModel setting

* ui: create GitSettings component for model selection

* ui: add Git section to OpenChamber settings sidebar

* ui: register GitSectionContent in OpenChamberPage

* server: use commitMessageModel setting for AI generation

* tauri: sanitize commitMessageModel in settings commands

* tauri: use commitMessageModel for desktop message generation

* build: update lockfile and package configuration

* refactor(openchamber): improve default model parsing with fallback logic

* feat(openchamber): improve model selection fallback logic

* refactor: move worktree settings into git section

* refactor(openchamber): merge worktree into git section

* refactor[worktree]: simplify empty state layout

* revert: rollback bun.lock and package.json to main

* feat(git): restrict model selection to OpenCode provider
This commit is contained in:
Nelson Pires
2026-01-14 00:21:16 +02:00
committed by GitHub
parent fbb058ed97
commit 279efb28b3
12 changed files with 319 additions and 49 deletions
+14 -1
View File
@@ -611,6 +611,10 @@ const sanitizeSettingsUpdate = (payload) => {
if (typeof candidate.autoCreateWorktree === 'boolean') {
result.autoCreateWorktree = candidate.autoCreateWorktree;
}
if (typeof candidate.commitMessageModel === 'string') {
const trimmed = candidate.commitMessageModel.trim();
result.commitMessageModel = trimmed.length > 0 ? trimmed : undefined;
}
const skillCatalogs = sanitizeSkillCatalogs(candidate.skillCatalogs);
if (skillCatalogs) {
@@ -3501,6 +3505,15 @@ async function main(options = {}) {
.join('\n\n');
const prompt = `You are drafting git commit notes for this codebase. Respond in JSON of the shape {"subject": string, "highlights": string[]} (ONLY the JSON in response, no markdown wrappers or anything except JSON) with these rules:\n- subject follows our convention: type[optional-scope]: summary (examples: "feat: add diff virtualization", "fix(chat): restore enter key handling")\n- allowed types: feat, fix, chore, style, refactor, perf, docs, test, build, ci (choose the best match or fallback to chore)\n- summary must be imperative, concise, <= 70 characters, no trailing punctuation\n- scope is optional; include only when obvious from filenames/folders; do not invent scopes\n- focus on the most impactful user-facing change; if multiple capabilities ship together, align the subject with the dominant theme and use highlights to cover the other major outcomes\n- highlights array should contain 2-3 plain sentences (<= 90 chars each) that describe distinct features or UI changes users will notice (e.g. "Add per-file revert action in Changes list"). Avoid subjective benefit statements, marketing tone, repeating the subject, or referencing helper function names. Highlight additions such as new controls/buttons, new actions (e.g. revert), or stored state changes explicitly. Skip highlights if fewer than two meaningful points exist.\n- text must be plain (no markdown bullets); each highlight should start with an uppercase verb\n\nDiff summary:\n${diffSummaries}`;
const settings = await readSettingsFromDiskMigrated();
const rawModel = typeof settings.commitMessageModel === 'string' ? settings.commitMessageModel.trim() : '';
const model = (() => {
if (!rawModel) return 'big-pickle';
const parts = rawModel.split('/').filter(Boolean);
const candidate = parts.length > 1 ? parts[parts.length - 1] : parts[0];
return candidate || 'big-pickle';
})();
const completionTimeout = createTimeoutSignal(LONG_REQUEST_TIMEOUT_MS);
let response;
@@ -3509,7 +3522,7 @@ async function main(options = {}) {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
model: 'big-pickle',
model,
messages: [{ role: 'user', content: prompt }],
max_tokens: 3000,
stream: false,