feat: hardcode wait time and default response as constants

Changes:
- Add DEFAULT_WAIT_SECONDS = 50 (replaces config.default_wait_seconds)
- Add DEFAULT_EMPTY_RESPONSE = 'call this tool... ' (replaces config.default_empty_response)
- Remove wait and empty response fields from WebUI Settings panel
  (only agent_stale_after_seconds remains configurable)
Rationale:
These values are fundamental to the 60s timeout mitigation strategy and
should not be user-configurable. The 50s wait with 5s keepalives is the
optimal balance for staying under the Copilot 60s wall-clock limit while
providing responsive progress feedback.
This commit is contained in:
Brandon Zhang
2026-03-27 15:45:06 +08:00
parent ba91349232
commit 4db402f258
2 changed files with 0 additions and 16 deletions

View File

@@ -158,16 +158,6 @@
</div> </div>
<div class="panel-body"> <div class="panel-body">
<form id="config-form"> <form id="config-form">
<div class="config-field">
<label class="config-label" for="cfg-wait">Wait (sec)</label>
<input id="cfg-wait" class="input input--sm" type="number" min="0" max="300" value="10" />
<span class="config-hint">How long the tool waits for a new instruction before returning an empty response. Set exclusively here — agents cannot override this.</span>
</div>
<div class="config-field">
<label class="config-label" for="cfg-empty">Empty Response</label>
<input id="cfg-empty" class="input input--sm" type="text" placeholder="Leave blank for no response" />
<span class="config-hint">Default text returned when queue is empty</span>
</div>
<div class="config-field"> <div class="config-field">
<label class="config-label" for="cfg-stale">Agent Stale After (sec)</label> <label class="config-label" for="cfg-stale">Agent Stale After (sec)</label>
<input id="cfg-stale" class="input input--sm" type="number" min="5" max="600" value="30" /> <input id="cfg-stale" class="input input--sm" type="number" min="5" max="600" value="30" />

View File

@@ -112,16 +112,12 @@ export function initStatus() {
export function initConfig() { export function initConfig() {
const form = document.getElementById('config-form'); const form = document.getElementById('config-form');
const waitInput = document.getElementById('cfg-wait');
const emptyInput = document.getElementById('cfg-empty');
const staleInput = document.getElementById('cfg-stale'); const staleInput = document.getElementById('cfg-stale');
const saveBtn = document.getElementById('cfg-save'); const saveBtn = document.getElementById('cfg-save');
// Populate from state // Populate from state
state.subscribe('config', (cfg) => { state.subscribe('config', (cfg) => {
if (!cfg) return; if (!cfg) return;
waitInput.value = cfg.default_wait_seconds;
emptyInput.value = cfg.default_empty_response;
staleInput.value = cfg.agent_stale_after_seconds; staleInput.value = cfg.agent_stale_after_seconds;
}); });
@@ -133,8 +129,6 @@ export function initConfig() {
try { try {
const cfg = await api.updateConfig({ const cfg = await api.updateConfig({
default_wait_seconds: parseInt(waitInput.value, 10) || 10,
default_empty_response: emptyInput.value,
agent_stale_after_seconds: parseInt(staleInput.value, 10) || 30, agent_stale_after_seconds: parseInt(staleInput.value, 10) || 30,
}); });
state.set('config', cfg); state.set('config', cfg);