feat(agent): enhance agent management with runtime and workspace directory removal, and improve agent ID listing (#387)

This commit is contained in:
Haze
2026-03-10 17:07:41 +08:00
committed by GitHub
Unverified
parent 36c0fcb5c7
commit d3960a3d0f
8 changed files with 380 additions and 21 deletions

View File

@@ -2,6 +2,7 @@ import { readdir, readFile, stat } from 'fs/promises';
import { join } from 'path';
import { getOpenClawConfigDir } from './paths';
import { logger } from './logger';
import { listConfiguredAgentIds } from './agent-config';
import { parseUsageEntriesFromJsonl, type TokenUsageHistoryEntry } from './token-usage-core';
export { parseUsageEntriesFromJsonl, type TokenUsageHistoryEntry } from './token-usage-core';
@@ -11,7 +12,7 @@ async function listRecentSessionFiles(): Promise<Array<{ filePath: string; sessi
const agentsDir = join(openclawDir, 'agents');
try {
const agentEntries = await readdir(agentsDir);
const agentEntries = await listConfiguredAgentIds();
const files: Array<{ filePath: string; sessionId: string; agentId: string; mtimeMs: number }> = [];
for (const agentId of agentEntries) {