@@ -1140,9 +1140,9 @@ export class Cline {
11401140 const contextWindow = this . api . getModel ( ) . info . contextWindow || 64_000 // minimum context (Deepseek)
11411141 const maxAllowedSize = getMaxAllowedSize ( contextWindow )
11421142
1143- const terminalInfo = await this . terminalManager . getOrCreateTerminal ( cwd , contextWindow )
1143+ const terminalInfo = await this . terminalManager . getOrCreateTerminal ( cwd )
11441144 terminalInfo . terminal . show ( ) // weird visual bug when creating new terminals (even manually) where there's an empty space at the top.
1145- const process = this . terminalManager . runCommand ( terminalInfo , command , maxAllowedSize )
1145+ const process = this . terminalManager . runCommand ( terminalInfo , command )
11461146
11471147 let userFeedback : { text ?: string ; images ?: string [ ] } | undefined
11481148 let didContinue = false
@@ -1188,7 +1188,7 @@ export class Cline {
11881188 // the correct order of messages (although the webview is smart about
11891189 // grouping command_output messages despite any gaps anyways)
11901190 await delay ( 50 )
1191- // AKF TODO -> investigate failed results
1191+
11921192 result = result . trim ( )
11931193
11941194 if ( userFeedback ) {
@@ -2963,16 +2963,6 @@ export class Cline {
29632963 throw new Error ( "Cline instance aborted" )
29642964 }
29652965
2966- // Log file content being passed to model
2967- userContent . forEach ( ( block ) => {
2968- if ( block . type === "text" && block . text ) {
2969- // Look for file content markers
2970- if ( block . text . includes ( "<file_content" ) || block . text . includes ( "<final_file_content" ) ) {
2971- console . log ( `[MODEL_INPUT] File content being passed to model. Content length: ${ block . text . length } chars` )
2972- }
2973- }
2974- } )
2975-
29762966 if ( this . consecutiveMistakeCount >= 3 ) {
29772967 if ( this . autoApprovalSettings . enabled && this . autoApprovalSettings . enableNotifications ) {
29782968 showSystemNotification ( {
@@ -3442,44 +3432,34 @@ export class Cline {
34423432 if ( busyTerminals . length > 0 ) {
34433433 // terminals are cool, let's retrieve their output
34443434 terminalDetails += "\n\n# Actively Running Terminals"
3445- const contextWindow = this . api . getModel ( ) . info . contextWindow || 64_000 // minimum context (Deepseek)
3446-
3447- // Get output from all busy terminals
3448- const busyOutputs = await Promise . all (
3449- busyTerminals . map ( async ( terminal ) => {
3450- const output = await this . terminalManager . getUnretrievedOutput ( terminal . id , contextWindow )
3451- return { terminal, output }
3452- } ) ,
3453- )
3454-
3455- // Add output to details
3456- for ( const { terminal, output } of busyOutputs ) {
3457- terminalDetails += `\n## Original command: \`${ terminal . lastCommand } \``
3458- if ( output ) {
3459- terminalDetails += `\n### New Output\n${ output } `
3435+ for ( const busyTerminal of busyTerminals ) {
3436+ terminalDetails += `\n## Original command: \`${ busyTerminal . lastCommand } \``
3437+ const newOutput = this . terminalManager . getUnretrievedOutput ( busyTerminal . id )
3438+ if ( newOutput ) {
3439+ terminalDetails += `\n### New Output\n${ newOutput } `
3440+ } else {
3441+ // details += `\n(Still running, no new output)` // don't want to show this right after running the command
34603442 }
34613443 }
34623444 }
34633445
34643446 // only show inactive terminals if there's output to show
34653447 if ( inactiveTerminals . length > 0 ) {
3466- const contextWindow = this . api . getModel ( ) . info . contextWindow || 64_000 // minimum context (Deepseek)
3467-
3468- // Get output from all inactive terminals
3469- const inactiveOutputs = await Promise . all (
3470- inactiveTerminals . map ( async ( terminal ) => {
3471- const output = await this . terminalManager . getUnretrievedOutput ( terminal . id , contextWindow )
3472- return { terminal, output }
3473- } ) ,
3474- )
3475-
3476- // Filter and add outputs that have content
3477- const outputsWithContent = inactiveOutputs . filter ( ( { output } ) => output )
3478- if ( outputsWithContent . length > 0 ) {
3448+ const inactiveTerminalOutputs = new Map < number , string > ( )
3449+ for ( const inactiveTerminal of inactiveTerminals ) {
3450+ const newOutput = await this . terminalManager . getUnretrievedOutput ( inactiveTerminal . id )
3451+ if ( newOutput ) {
3452+ inactiveTerminalOutputs . set ( inactiveTerminal . id , newOutput )
3453+ }
3454+ }
3455+ if ( inactiveTerminalOutputs . size > 0 ) {
34793456 terminalDetails += "\n\n# Inactive Terminals"
3480- for ( const { terminal, output } of outputsWithContent ) {
3481- terminalDetails += `\n## ${ terminal . lastCommand } `
3482- terminalDetails += `\n### New Output\n${ output } `
3457+ for ( const [ terminalId , newOutput ] of inactiveTerminalOutputs ) {
3458+ const inactiveTerminal = inactiveTerminals . find ( ( t ) => t . id === terminalId )
3459+ if ( inactiveTerminal ) {
3460+ terminalDetails += `\n## ${ inactiveTerminal . lastCommand } `
3461+ terminalDetails += `\n### New Output\n${ newOutput } `
3462+ }
34833463 }
34843464 }
34853465 }
0 commit comments