mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-06 23:49:41 +02:00
Merge pull request #73 from TeigenZhang/feat/thinking-effort
feat: thinking effort setting for new sessions (with xhigh/max)
This commit is contained in:
@@ -1095,6 +1095,18 @@
|
|||||||
</label>
|
</label>
|
||||||
<span class="form-hint">Use 1M token context window (model: opus[1m]) for all new sessions</span>
|
<span class="form-hint">Use 1M token context window (model: opus[1m]) for all new sessions</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<label>Thinking Effort</label>
|
||||||
|
<select id="appSettingsThinkingEffort" class="form-select">
|
||||||
|
<option value="">Default</option>
|
||||||
|
<option value="low">Low</option>
|
||||||
|
<option value="medium">Medium</option>
|
||||||
|
<option value="high">High</option>
|
||||||
|
<option value="xhigh">XHigh</option>
|
||||||
|
<option value="max">Max</option>
|
||||||
|
</select>
|
||||||
|
<span class="form-hint">Set CLAUDE_CODE_EFFORT_LEVEL for all new sessions (default = no override)</span>
|
||||||
|
</div>
|
||||||
<!-- Nice Priority Section -->
|
<!-- Nice Priority Section -->
|
||||||
<div class="form-section-header">Nice Priority</div>
|
<div class="form-section-header">Nice Priority</div>
|
||||||
<div class="form-row form-row-switch">
|
<div class="form-row form-row-switch">
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ const KeyboardAccessoryBar = {
|
|||||||
</button>
|
</button>
|
||||||
<button class="accessory-btn" data-action="tab" title="Tab">Tab</button>
|
<button class="accessory-btn" data-action="tab" title="Tab">Tab</button>
|
||||||
<button class="accessory-btn" data-action="shift-tab" title="Shift+Tab">⇧Tab</button>
|
<button class="accessory-btn" data-action="shift-tab" title="Shift+Tab">⇧Tab</button>
|
||||||
|
<button class="accessory-btn" data-action="effort-max" title="/effort max">Max</button>
|
||||||
<button class="accessory-btn" data-action="ctrl-o" title="Ctrl+O">⌃O</button>
|
<button class="accessory-btn" data-action="ctrl-o" title="Ctrl+O">⌃O</button>
|
||||||
<button class="accessory-btn" data-action="opt-enter" title="Option+Enter (newline)">⌥Enter</button>
|
<button class="accessory-btn" data-action="opt-enter" title="Option+Enter (newline)">⌥Enter</button>
|
||||||
<button class="accessory-btn" data-action="esc" title="Escape">Esc</button>
|
<button class="accessory-btn" data-action="esc" title="Escape">Esc</button>
|
||||||
@@ -125,7 +126,7 @@ const KeyboardAccessoryBar = {
|
|||||||
this.handleAction(action, btn);
|
this.handleAction(action, btn);
|
||||||
|
|
||||||
// Refocus terminal so keyboard stays open (tap blurs terminal → keyboard dismisses → toolbar shifts)
|
// Refocus terminal so keyboard stays open (tap blurs terminal → keyboard dismisses → toolbar shifts)
|
||||||
const refocusActions = new Set(['scroll-up', 'scroll-down', 'arrow-left', 'arrow-right', 'tab', 'shift-tab', 'ctrl-o', 'opt-enter', 'esc']);
|
const refocusActions = new Set(['scroll-up', 'scroll-down', 'arrow-left', 'arrow-right', 'tab', 'shift-tab', 'ctrl-o', 'opt-enter', 'esc', 'effort-max']);
|
||||||
if (refocusActions.has(action) ||
|
if (refocusActions.has(action) ||
|
||||||
((action === 'clear' || action === 'compact') && this._confirmAction)) {
|
((action === 'clear' || action === 'compact') && this._confirmAction)) {
|
||||||
if (typeof app !== 'undefined' && app.terminal) {
|
if (typeof app !== 'undefined' && app.terminal) {
|
||||||
@@ -184,6 +185,9 @@ const KeyboardAccessoryBar = {
|
|||||||
case 'ctrl-o':
|
case 'ctrl-o':
|
||||||
this.sendKey('\x0f');
|
this.sendKey('\x0f');
|
||||||
break;
|
break;
|
||||||
|
case 'effort-max':
|
||||||
|
this.sendCommand('/effort max');
|
||||||
|
break;
|
||||||
case 'init':
|
case 'init':
|
||||||
this.sendCommand('/init');
|
this.sendCommand('/init');
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -323,6 +323,10 @@ Object.assign(CodemanApp.prototype, {
|
|||||||
if (caseSettings.agentTeams || globalSettings.agentTeamsEnabled) {
|
if (caseSettings.agentTeams || globalSettings.agentTeamsEnabled) {
|
||||||
envOverrides.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS = '1';
|
envOverrides.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS = '1';
|
||||||
}
|
}
|
||||||
|
const thinkingEffort = globalSettings.thinkingEffort;
|
||||||
|
if (thinkingEffort) {
|
||||||
|
envOverrides.CLAUDE_CODE_EFFORT_LEVEL = thinkingEffort;
|
||||||
|
}
|
||||||
const hasEnvOverrides = Object.keys(envOverrides).length > 0;
|
const hasEnvOverrides = Object.keys(envOverrides).length > 0;
|
||||||
const useOpus1m = caseSettings.opusContext1m || globalSettings.opusContext1mEnabled;
|
const useOpus1m = caseSettings.opusContext1m || globalSettings.opusContext1mEnabled;
|
||||||
const modelOverride = useOpus1m ? 'opus[1m]' : '';
|
const modelOverride = useOpus1m ? 'opus[1m]' : '';
|
||||||
|
|||||||
@@ -334,6 +334,7 @@ Object.assign(CodemanApp.prototype, {
|
|||||||
// Claude Permissions settings
|
// Claude Permissions settings
|
||||||
document.getElementById('appSettingsAgentTeams').checked = settings.agentTeamsEnabled ?? false;
|
document.getElementById('appSettingsAgentTeams').checked = settings.agentTeamsEnabled ?? false;
|
||||||
document.getElementById('appSettingsOpusContext1m').checked = settings.opusContext1mEnabled ?? false;
|
document.getElementById('appSettingsOpusContext1m').checked = settings.opusContext1mEnabled ?? false;
|
||||||
|
document.getElementById('appSettingsThinkingEffort').value = settings.thinkingEffort ?? '';
|
||||||
// CPU Priority settings
|
// CPU Priority settings
|
||||||
const niceSettings = settings.nice || {};
|
const niceSettings = settings.nice || {};
|
||||||
document.getElementById('appSettingsNiceEnabled').checked = niceSettings.enabled ?? false;
|
document.getElementById('appSettingsNiceEnabled').checked = niceSettings.enabled ?? false;
|
||||||
@@ -1134,6 +1135,7 @@ Object.assign(CodemanApp.prototype, {
|
|||||||
// Claude Permissions settings
|
// Claude Permissions settings
|
||||||
agentTeamsEnabled: document.getElementById('appSettingsAgentTeams').checked,
|
agentTeamsEnabled: document.getElementById('appSettingsAgentTeams').checked,
|
||||||
opusContext1mEnabled: document.getElementById('appSettingsOpusContext1m').checked,
|
opusContext1mEnabled: document.getElementById('appSettingsOpusContext1m').checked,
|
||||||
|
thinkingEffort: document.getElementById('appSettingsThinkingEffort').value,
|
||||||
// CPU Priority settings
|
// CPU Priority settings
|
||||||
nice: {
|
nice: {
|
||||||
enabled: document.getElementById('appSettingsNiceEnabled').checked,
|
enabled: document.getElementById('appSettingsNiceEnabled').checked,
|
||||||
|
|||||||
@@ -267,6 +267,7 @@ export const SettingsUpdateSchema = z
|
|||||||
tunnelEnabled: z.boolean().optional(),
|
tunnelEnabled: z.boolean().optional(),
|
||||||
tabTwoRows: z.boolean().optional(),
|
tabTwoRows: z.boolean().optional(),
|
||||||
agentTeamsEnabled: z.boolean().optional(),
|
agentTeamsEnabled: z.boolean().optional(),
|
||||||
|
thinkingEffort: z.string().max(20).optional(),
|
||||||
// UI visibility
|
// UI visibility
|
||||||
showFontControls: z.boolean().optional(),
|
showFontControls: z.boolean().optional(),
|
||||||
showSystemStats: z.boolean().optional(),
|
showSystemStats: z.boolean().optional(),
|
||||||
|
|||||||
Reference in New Issue
Block a user