feat(hermes): add worktree session setting

This commit is contained in:
晴天
2026-05-26 05:50:12 +08:00
parent 51be3ab4ca
commit 975613416d
6 changed files with 68 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ const SESSION_RUNTIME_DEFAULTS = {
atHour: 4,
groupSessionsPerUser: true,
threadSessionsPerUser: false,
worktreeEnabled: false,
}
const COMPRESSION_DEFAULTS = {
@@ -498,6 +499,10 @@ export function render() {
<input id="hm-thread-sessions-per-user" type="checkbox" ${runtimeValues.threadSessionsPerUser ? 'checked' : ''} ${disabled ? 'disabled' : ''}>
<span>${t('engine.hermesThreadSessionsPerUser')}</span>
</label>
<label class="hm-channel-check">
<input id="hm-worktree-enabled" type="checkbox" ${runtimeValues.worktreeEnabled ? 'checked' : ''} ${disabled ? 'disabled' : ''}>
<span>${t('engine.hermesWorktreeEnabled')}</span>
</label>
</div>
<div class="hm-channel-footnote">${t('engine.hermesSessionRuntimeFootnote')}</div>
</div>
@@ -2727,6 +2732,7 @@ export function render() {
atHour: el.querySelector('#hm-session-at-hour')?.value || '4',
groupSessionsPerUser: !!el.querySelector('#hm-group-sessions-per-user')?.checked,
threadSessionsPerUser: !!el.querySelector('#hm-thread-sessions-per-user')?.checked,
worktreeEnabled: !!el.querySelector('#hm-worktree-enabled')?.checked,
}
runtimeSaving = true
runtimeError = null

View File

@@ -497,7 +497,8 @@ export default {
hermesSessionAtHour: _('每日换新小时', 'Daily reset hour', '每日換新小時'),
hermesGroupSessionsPerUser: _('群聊按成员隔离会话', 'Isolate group sessions per user', '群聊依成員隔離會話'),
hermesThreadSessionsPerUser: _('线程也按成员隔离', 'Isolate thread sessions per user', '討論串也依成員隔離'),
hermesSessionRuntimeFootnote: _('推荐保持群聊隔离开启。关闭后,同一群/频道会共用上下文和中断状态。', 'Keeping group isolation on is recommended. Turning it off shares context and interrupt state across the same group or channel.', '建議保持群聊隔離開啟。關閉後,同一群組/頻道會共用上下文和中斷狀態。'),
hermesWorktreeEnabled: _('CLI 会话默认使用 Git worktree 隔离', 'Use Git worktree isolation for CLI sessions by default', 'CLI 會話預設使用 Git worktree 隔離'),
hermesSessionRuntimeFootnote: _('推荐保持群聊隔离开启;多人或多 Agent 同仓库长跑时,可开启 worktree 隔离来减少文件冲突。', 'Keeping group isolation on is recommended. For multi-user or multi-agent long runs in the same repository, enable worktree isolation to reduce file conflicts.', '建議保持群聊隔離開啟;多人或多 Agent 同倉庫長跑時,可啟用 worktree 隔離以減少檔案衝突。'),
hermesTerminalConfigTitle: _('终端执行', 'Terminal execution', '終端執行'),
hermesTerminalConfigDesc: _('控制 Hermes 工具命令的执行环境、工作目录、超时和容器资源,避免长任务卡死或沙箱范围误配。', 'Control command execution backend, working directory, timeouts, and container resources to avoid stuck runs or sandbox misconfiguration.', '控制 Hermes 工具命令的執行環境、工作目錄、逾時和容器資源,避免長任務卡死或沙箱範圍誤配。'),
hermesTerminalConfigStatusReady: _('结构化配置', 'structured settings', '結構化設定'),