refactor: remove SERVICE_AGENT_TYPE legacy constant

SERVICE_AGENT_TYPE was always 'claude-code' in the unified service,
making it a misleading constant. Each group already has its own
agentType field.

- Removed SERVICE_AGENT_TYPE from config.ts
- Session functions now accept agentType parameter (default: 'claude-code')
- Task scheduler uses task-level agent_type for token rotation decisions
- All fallback defaults changed to 'claude-code' literal
- Logging uses 'unified' instead of the misleading type
This commit is contained in:
Eyejoker
2026-03-30 23:10:48 +09:00
parent 5562e30ce1
commit 4a5edaceb6
12 changed files with 56 additions and 54 deletions

View File

@@ -6,7 +6,6 @@ import { CronExpressionParser } from 'cron-parser';
import {
DATA_DIR,
IPC_POLL_INTERVAL,
SERVICE_AGENT_TYPE,
TIMEZONE,
} from './config.js';
import { readJsonFile } from './utils.js';
@@ -433,7 +432,7 @@ export async function processTaskIpc(
id: taskId,
group_folder: targetFolder,
chat_jid: resolvedTargetJid,
agent_type: targetGroupEntry.agentType || SERVICE_AGENT_TYPE,
agent_type: targetGroupEntry.agentType || 'claude-code',
ci_provider: data.ci_provider ?? null,
ci_metadata: data.ci_metadata ?? null,
max_duration_ms: isWatchCiTask({ prompt: data.prompt })
@@ -453,7 +452,7 @@ export async function processTaskIpc(
sourceGroup,
targetFolder,
contextMode,
agentType: targetGroupEntry.agentType || SERVICE_AGENT_TYPE,
agentType: targetGroupEntry.agentType || 'claude-code',
},
'Task created via IPC',
);