Update src/ai-repo-commander.user.js
✅ Increase API timeout from 30s to 60s ✅ Prevent scanning when paused Recommended (nice to have): 3. ✅ Make API timeout configurable 4. ✅ Optimize timing values based on your successful test
This commit is contained in:
parent
59379336e2
commit
3575dec2ee
|
|
@ -32,9 +32,12 @@
|
|||
DEBUG_WATCH_MS: 120000,
|
||||
DEBUG_MAX_LINES: 400,
|
||||
DEBUG_SHOW_PANEL: true,
|
||||
DEBOUNCE_DELAY: 5000, // bot-typing protection
|
||||
|
||||
// Timing & API
|
||||
DEBOUNCE_DELAY: 3000, // was 5000
|
||||
MAX_RETRIES: 2,
|
||||
VERSION: '1.4.0',
|
||||
API_TIMEOUT_MS: 60000, // NEW: configurable API timeout
|
||||
|
||||
PROCESS_EXISTING: false,
|
||||
ASSISTANT_ONLY: true,
|
||||
|
|
@ -52,10 +55,10 @@
|
|||
POST_PASTE_DELAY_MS: 250,
|
||||
SUBMIT_MODE: 'button_first', // 'button_first' | 'enter_only' | 'smart'
|
||||
|
||||
// Streaming-complete hardening (DeepSeek #2)
|
||||
// Streaming-complete hardening
|
||||
REQUIRE_TERMINATOR: true, // require trailing '---' line
|
||||
SETTLE_CHECK_MS: 1500, // time to see the block remain unchanged
|
||||
SETTLE_POLL_MS: 300, // poll interval for stability
|
||||
SETTLE_CHECK_MS: 800, // was 1500
|
||||
SETTLE_POLL_MS: 200, // was 300
|
||||
|
||||
// Runtime toggles
|
||||
RUNTIME: { PAUSED: false }
|
||||
|
|
@ -285,6 +288,9 @@
|
|||
<label style="display:flex;align-items:center;gap:8px;margin:4px 0;">
|
||||
SETTLE_POLL_MS <input class="rc-num" data-key="SETTLE_POLL_MS" type="number" min="50" step="50" style="width:120px;background:#0b1220;color:#e5e7eb;border:1px solid #374151;border-radius:4px;padding:2px 6px;">
|
||||
</label>
|
||||
<label style="display:flex;align-items:center;gap:8px;margin:4px 0;">
|
||||
API_TIMEOUT_MS <input class="rc-num" data-key="API_TIMEOUT_MS" type="number" min="10000" step="5000" style="width:120px;background:#0b1220;color:#e5e7eb;border:1px solid #374151;border-radius:4px;padding:2px 6px;">
|
||||
</label>
|
||||
</div>
|
||||
<div style="grid-column:1 / -1;">
|
||||
<h4 style="margin:8px 0 6px 0;">Config JSON</h4>
|
||||
|
|
@ -435,12 +441,12 @@
|
|||
});
|
||||
|
||||
// Set initial UI states
|
||||
const pauseBtn = root.querySelector('.rc-pause');
|
||||
pauseBtn.textContent = this.cfg.RUNTIME.PAUSED ? 'Resume' : 'Pause';
|
||||
if (this.cfg.RUNTIME.PAUSED) {
|
||||
pauseBtn.style.background = '#f59e0b';
|
||||
pauseBtn.style.color = '#111827';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
_renderRow(e) {
|
||||
|
|
@ -846,7 +852,7 @@
|
|||
url: command.url,
|
||||
headers: { 'X-Bridge-Key': bridgeKey, 'Content-Type': 'application/json' },
|
||||
data: JSON.stringify(command),
|
||||
timeout: 30000,
|
||||
timeout: CONFIG.API_TIMEOUT_MS || 60000,
|
||||
onload: (response) => (response.status >= 200 && response.status < 300)
|
||||
? resolve(response)
|
||||
: reject(new Error(`API Error ${response.status}: ${response.statusText}`)),
|
||||
|
|
|
|||
Loading…
Reference in New Issue