@@ -19,6 +19,7 @@ import {
1919} from '../utils/terminal'
2020
2121import type { SubagentData } from '../subagent-storage'
22+ import { logger } from '../utils/logger'
2223
2324// Add helpers to truncate to first line and reduce sections
2425function firstLine ( text : string ) : string {
@@ -52,6 +53,9 @@ export function isInSubagentBufferMode(): boolean {
5253 * Display a formatted list of traces with enhanced styling
5354 */
5455export function displaySubagentList ( agents : SubagentData [ ] ) {
56+ // Added: log list render
57+ logger . debug ( { count : agents . length } , 'Rendering subagent list!' )
58+
5559 console . log ( bold ( cyan ( '🤖 Available Traces' ) ) )
5660 console . log ( gray ( `Found ${ pluralize ( agents . length , 'trace' ) } ` ) )
5761 console . log ( )
@@ -63,6 +67,7 @@ export function displaySubagentList(agents: SubagentData[]) {
6367 // Truncate prompt preview to first line
6468 const promptFirst = agent . prompt ? firstLine ( agent . prompt ) : '(no prompt)'
6569 const promptPreview = gray ( promptFirst )
70+
6671 console . log (
6772 ` ${ status } ${ bold ( agent . agentId ) } ${ gray ( `(${ agent . agentType } )` ) } ` ,
6873 )
@@ -71,7 +76,6 @@ export function displaySubagentList(agents: SubagentData[]) {
7176 } )
7277 }
7378}
74-
7579export function enterSubagentBuffer (
7680 rl : any ,
7781 agentId : string ,
@@ -168,6 +172,16 @@ function updateSubagentContent() {
168172 if ( agentData . prompt ) {
169173 const promptLine = bold ( gray ( `Prompt: ${ firstLine ( agentData . prompt ) } ` ) )
170174 wrappedLines . push ( ...wrapLine ( promptLine , terminalWidth ) )
175+ }
176+
177+ // Add credits used if any
178+ if ( agentData . creditsUsed > 0 ) {
179+ const creditsLine = yellow ( `${ pluralize ( agentData . creditsUsed , 'credit' ) } ` )
180+ wrappedLines . push ( ...wrapLine ( creditsLine , terminalWidth ) )
181+ }
182+
183+ // Add a separator line if we added prompt or credits
184+ if ( agentData . prompt || agentData . creditsUsed > 0 ) {
171185 wrappedLines . push ( '' )
172186 }
173187
0 commit comments