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

@@ -32,7 +32,7 @@ interface ContainerInput {
interface ContainerOutput {
status: 'success' | 'error';
phase?: 'progress' | 'final';
phase?: 'progress' | 'final' | 'tool-activity';
result: string | null;
newSessionId?: string;
error?: string;
@@ -554,6 +554,7 @@ async function runQuery(
if (message.type === 'system' && (message as { subtype?: string }).subtype === 'task_progress') {
const tp = message as Record<string, unknown>;
const summary = typeof tp.summary === 'string' ? tp.summary : '';
const description = typeof tp.description === 'string' ? tp.description : '';
if (summary) {
log(`Subagent progress: ${summary.slice(0, 200)}`);
writeOutput({
@@ -563,6 +564,14 @@ async function runQuery(
newSessionId,
});
}
if (description) {
writeOutput({
status: 'success',
phase: 'tool-activity',
result: description,
newSessionId,
});
}
}
if (message.type === 'system' && (message as { subtype?: string }).subtype === 'task_started') {