fix(settings): simplify Pi-only agent configuration

This commit is contained in:
Sycun committed 2026-11-11 16:34:46 +08:00
1 parent 4e76d922a4
commit 1452c15f5f
6 files changed
+23 -36

No files matched your search

+1 -1
View File
@@ -15,7 +15,7 @@ The launcher and self-update build prepare the worker. Dependency installation u
## Configuration
`agent_runtime.engine` accepts only `pi` (also the default). The former engine and dependencies have been removed. Optional `node_path`, `worker_path`, and `session_dir` control deployment. Settings displays Pi and exposes the DSH-Purge-derived capability guidance. `purge.model_instructions` provides additive guidance by exact `provider/model` or model ID.
`agent_runtime.engine` accepts only `pi` (also the default). The former engine and dependencies have been removed. Optional `node_path`, `worker_path`, and `session_dir` control deployment. Under Agent config → Advanced settings, you can turn the built-in work guidance on or off and add optional instructions. When enabled, a blank field still uses the built-in guidance; turning it off omits both the built-in guidance and additional instructions. `purge.model_instructions` provides additive guidance by exact `provider/model` or model ID.
The guidance combines capability selection, main/child task anchors and evidence requirements. It does not ship DSH host patches or encrypted identity prompts. Attribution is in `runtime/pi/THIRD_PARTY_NOTICES.md`.
+1 -1
View File
@@ -26,7 +26,7 @@ agent_runtime:
"provider/model-id": "此模型的额外工作约定"
```
设置页显示唯一的 Pi 运行时,可开关能力增强及编辑附加指令。`worker_path` 是管理员的显式覆盖,适合开发或独立打包;留空使用源码指纹校验后的构建包。未填写 engine 的新代码默认使用 Pi;现有部署的运行数据和模型配置不会因此自动迁移或部署。
系统固定使用 Pi。「Agent 配置 → 高级设置」可开关内置工作提示及编辑附加指令。开启时,附加指令留空仍会使用内置提示;关闭时,两者都不加入模型提示词。`worker_path` 是管理员的显式覆盖,适合开发或独立打包;留空使用源码指纹校验后的构建包。现有部署的运行数据和模型配置不会因此自动迁移或部署。
## 执行边界
+4 -4
View File
@@ -3283,10 +3283,10 @@
"testErrorForbidden": "Request denied. Check account permissions or model access.",
"testErrorModelUnavailable": "Model is unavailable or the model name is incorrect.",
"testErrorBaseUrl": "Base URL is unavailable. Check that the endpoint is correct.",
"agentRuntime": "Agent runtime",
"purgeEnabled": "Enable DSH-Purge capability guidance",
"purgeHint": "Add capability selection, task anchors and evidence requirements to main and child agents.",
"purgeInstruction": "Model guidance"
"purgeEnabled": "Use built-in work guidance",
"purgeHint": "Give main agents and subagents guidance on choosing tools, following up on tasks and recording evidence. Tool permissions stay the same.",
"purgeInstruction": "Additional work instructions (optional)",
"purgeInstructionHint": "These instructions apply to all models when built-in work guidance is enabled. Leave blank to keep using the built-in guidance."
},
"settingsTerminal": {
"title": "Terminal",
+4 -4
View File
@@ -3271,10 +3271,10 @@
"testErrorForbidden": "请求被拒绝,请检查账号权限或模型访问权限",
"testErrorModelUnavailable": "模型不可用或模型名不正确,请检查模型名称",
"testErrorBaseUrl": "Base URL 不可用,请检查地址是否正确",
"agentRuntime": "智能体运行时",
"purgeEnabled": "启用 DSH-Purge 能力增强",
"purgeHint": "为主代理和子代理补充能力选择、任务锚点与证据要求。",
"purgeInstruction": "模型增强指令"
"purgeEnabled": "使用内置工作提示",
"purgeHint": "为主代理和子代理添加工具选择、任务跟进和证据记录提示,不改变工具权限。",
"purgeInstruction": "附加工作指令(可选)",
"purgeInstructionHint": "开启内置工作提示后,此处的指令适用于所有模型。留空仍会使用内置提示。"
},
"settingsTerminal": {
"title": "终端",
+3 -8
View File
@@ -883,13 +883,11 @@ async function loadConfig(loadTools = true, options = {}) {
}
// 填充Agent配置
const runtimeConfig = currentConfig.agent_runtime || {};
const runtimeEngineEl = document.getElementById('agent-runtime-engine');
if (runtimeEngineEl) runtimeEngineEl.value = runtimeConfig.engine || 'pi';
const promptProfile = currentConfig.agent_runtime?.purge;
const purgeEnabledEl = document.getElementById('agent-purge-enabled');
if (purgeEnabledEl) purgeEnabledEl.checked = runtimeConfig.purge?.enabled !== false;
if (purgeEnabledEl) purgeEnabledEl.checked = promptProfile?.enabled !== false;
const purgeInstructionEl = document.getElementById('agent-purge-instruction');
if (purgeInstructionEl) purgeInstructionEl.value = runtimeConfig.purge?.instruction || '';
if (purgeInstructionEl) purgeInstructionEl.value = promptProfile?.instruction || '';
document.getElementById('agent-max-iterations').value = currentConfig.agent.max_iterations || 30;
const toolWaitTimeoutEl = document.getElementById('agent-tool-wait-timeout-seconds');
if (toolWaitTimeoutEl) {
@@ -2084,10 +2082,7 @@ async function applySettings() {
audit_agent_prompt_review_edit: document.getElementById('hitl-audit-agent-prompt-review-edit-settings')?.value.trim() || ''
},
agent_runtime: {
...(currentConfig.agent_runtime || {}),
engine: document.getElementById('agent-runtime-engine')?.value || currentConfig.agent_runtime?.engine || 'pi',
purge: {
...(currentConfig.agent_runtime?.purge || {}),
enabled: document.getElementById('agent-purge-enabled')?.checked ?? currentConfig.agent_runtime?.purge?.enabled ?? true,
instruction: document.getElementById('agent-purge-instruction')?.value ?? currentConfig.agent_runtime?.purge?.instruction ?? ''
}
+10 -18
View File
@@ -3950,18 +3950,6 @@
<div class="settings-subsection">
<h4 data-i18n="settingsBasic.agentConfig">Agent 配置</h4>
<div class="settings-form">
<div class="form-group">
<label for="agent-runtime-engine" data-i18n="settingsBasic.agentRuntime">智能体运行时</label>
<select id="agent-runtime-engine"><option value="pi">Pi Agent</option></select>
</div>
<div class="form-group">
<label><input type="checkbox" id="agent-purge-enabled" /> <span data-i18n="settingsBasic.purgeEnabled">启用 DSH-Purge 能力增强</span></label>
<small class="form-hint" data-i18n="settingsBasic.purgeHint">为主代理和子代理补充能力选择、任务锚点与证据要求。</small>
</div>
<div class="form-group">
<label for="agent-purge-instruction" data-i18n="settingsBasic.purgeInstruction">模型增强指令</label>
<textarea id="agent-purge-instruction" rows="4"></textarea>
</div>
<div class="form-group">
<label for="agent-max-iterations" data-i18n="settingsBasic.maxIterations">最大迭代次数</label>
<input type="number" id="agent-max-iterations" min="1" data-i18n="settingsBasic.iterationsPlaceholder" data-i18n-attr="placeholder" placeholder="30" />
@@ -4037,13 +4025,17 @@
<input type="number" id="pi-model-failover-max-retries" min="0" step="1" placeholder="0" />
<small class="form-hint" data-i18n="settingsBasic.piModelFailoverMaxRetriesHint">0 表示尝试全部已配置备用通道;大于 0 时限制最多切换几个通道。</small>
</div>
<div class="form-group">
<label><input type="checkbox" id="agent-purge-enabled" aria-describedby="agent-purge-hint" /> <span data-i18n="settingsBasic.purgeEnabled">使用内置工作提示</span></label>
<small id="agent-purge-hint" class="form-hint" data-i18n="settingsBasic.purgeHint">为主代理和子代理添加工具选择、任务跟进和证据记录提示,不改变工具权限。</small>
</div>
<div class="form-group">
<label for="agent-purge-instruction" data-i18n="settingsBasic.purgeInstruction">附加工作指令(可选)</label>
<textarea id="agent-purge-instruction" rows="3" aria-describedby="agent-purge-instruction-hint"></textarea>
<small id="agent-purge-instruction-hint" class="form-hint" data-i18n="settingsBasic.purgeInstructionHint">开启内置工作提示后,此处的指令适用于所有模型。留空仍会使用内置提示。</small>
</div>
</div>
</details>
</details>
</div>
</div>
<div class="settings-actions">