feat: show tool activity sub-lines in progress messages

Display subagent tool descriptions as sub-lines under the main
progress text, updating in-place via Discord message edit.
Shows up to 5 recent tool activities (e.g., "Reading index.ts").
This commit is contained in:
Eyejoker
2026-03-23 18:31:20 +09:00
parent bf1453541f
commit ac11cb7df1
3 changed files with 49 additions and 5 deletions

View File

@@ -41,7 +41,7 @@ export interface AgentInput {
export interface AgentOutput {
status: 'success' | 'error';
result: string | null;
phase?: 'progress' | 'final';
phase?: 'progress' | 'final' | 'tool-activity';
newSessionId?: string;
error?: string;
}
@@ -238,7 +238,11 @@ export async function runAgentProcess(
const lines = chunk.trim().split('\n');
for (const line of lines) {
if (!line) continue;
if (line.includes('Turn in progress') || line.includes('Subagent') || line.includes('Intermediate assistant')) {
if (
line.includes('Turn in progress') ||
line.includes('Subagent') ||
line.includes('Intermediate assistant')
) {
logger.info(
{ group: group.name, chatJid: input.chatJid, runId: input.runId },
line.replace(/^\[.*?\]\s*/, ''),