Add files via upload

This commit is contained in:
公明
2026-06-02 13:34:12 +08:00
committed by GitHub
parent 203a99bed4
commit b8b1e8431b
9 changed files with 66 additions and 97 deletions
+11 -14
View File
@@ -15,7 +15,7 @@ function _tPlain(key, opts) {
}
/** 与创建队列 / API 一致的合法 agentMode */
const BATCH_QUEUE_AGENT_MODES = ['single', 'eino_single', 'deep', 'plan_execute', 'supervisor'];
const BATCH_QUEUE_AGENT_MODES = ['eino_single', 'deep', 'plan_execute', 'supervisor'];
function isBatchQueueAgentMode(mode) {
return BATCH_QUEUE_AGENT_MODES.indexOf(String(mode || '').toLowerCase()) >= 0;
@@ -23,13 +23,12 @@ function isBatchQueueAgentMode(mode) {
/** 批量队列 agentMode 展示文案(与对话模式命名一致) */
function batchQueueAgentModeLabel(mode) {
const m = String(mode || 'single').toLowerCase();
if (m === 'single') return _t('chat.agentModeReactNative');
const m = String(mode || 'eino_single').toLowerCase();
if (m === 'eino_single') return _t('chat.agentModeEinoSingle');
if (m === 'multi' || m === 'deep') return _t('chat.agentModeDeep');
if (m === 'deep') return _t('chat.agentModeDeep');
if (m === 'plan_execute') return _t('chat.agentModePlanExecuteLabel');
if (m === 'supervisor') return _t('chat.agentModeSupervisorLabel');
return _t('chat.agentModeReactNative');
return _t('chat.agentModeEinoSingle');
}
/** Cron 队列在「本轮 completed」等状态下的展示文案(底层 status 不变,仅 UI 强调循环调度) */
@@ -867,7 +866,7 @@ async function showBatchImportModal() {
projectSelect.value = '';
}
if (agentModeSelect) {
agentModeSelect.value = 'single';
agentModeSelect.value = 'eino_single';
}
if (scheduleModeSelect) {
scheduleModeSelect.value = 'manual';
@@ -997,8 +996,8 @@ async function createBatchQueue() {
// 获取角色(可选,空字符串表示默认角色)
const role = roleSelect ? roleSelect.value || '' : '';
const projectId = projectSelect ? (projectSelect.value || '').trim() : '';
const rawMode = agentModeSelect ? agentModeSelect.value : 'single';
const agentMode = isBatchQueueAgentMode(rawMode) ? rawMode : 'single';
const rawMode = agentModeSelect ? agentModeSelect.value : 'eino_single';
const agentMode = isBatchQueueAgentMode(rawMode) ? rawMode : 'eino_single';
const scheduleMode = scheduleModeSelect ? (scheduleModeSelect.value === 'cron' ? 'cron' : 'manual') : 'manual';
const cronExpr = cronExprInput ? cronExprInput.value.trim() : '';
const executeNow = executeNowCheckbox ? !!executeNowCheckbox.checked : false;
@@ -2217,12 +2216,10 @@ function startInlineEditAgentMode() {
if (!queueId) return;
apiFetch(`/api/batch-tasks/${queueId}`).then(r => r.json()).then(detail => {
const queue = detail.queue;
let currentMode = (queue.agentMode || 'single').toLowerCase();
if (currentMode === 'multi') currentMode = 'deep';
if (!isBatchQueueAgentMode(currentMode)) currentMode = 'single';
let currentMode = (queue.agentMode || 'eino_single').toLowerCase();
if (!isBatchQueueAgentMode(currentMode)) currentMode = 'eino_single';
container.innerHTML = `<span class="bq-inline-edit-controls">
<select id="bq-edit-agentmode">
<option value="single" ${currentMode === 'single' ? 'selected' : ''}>${escapeHtml(_t('chat.agentModeReactNative'))}</option>
<option value="eino_single" ${currentMode === 'eino_single' ? 'selected' : ''}>${escapeHtml(_t('chat.agentModeEinoSingle'))}</option>
<option value="deep" ${currentMode === 'deep' ? 'selected' : ''}>${escapeHtml(_t('chat.agentModeDeep'))}</option>
<option value="plan_execute" ${currentMode === 'plan_execute' ? 'selected' : ''}>${escapeHtml(_t('chat.agentModePlanExecuteLabel'))}</option>
@@ -2247,8 +2244,8 @@ async function saveInlineAgentMode() {
const queueId = batchQueuesState.currentQueueId;
if (!queueId) { _bqInlineSaving = false; return; }
const sel = document.getElementById('bq-edit-agentmode');
const raw = sel ? sel.value : 'single';
const agentMode = isBatchQueueAgentMode(raw) ? raw : 'single';
const raw = sel ? sel.value : 'eino_single';
const agentMode = isBatchQueueAgentMode(raw) ? raw : 'eino_single';
try {
const detailResp = await apiFetch(`/api/batch-tasks/${queueId}`);
const detail = await detailResp.json();