Skip to content

Commit 7bcff07

Browse files
authored
fix(tarko-cli): prevent console interceptor recursion in debug mode (#1279)
1 parent 2c13c04 commit 7bcff07

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

multimodal/tarko/agent-cli/src/utils/console-interceptor.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
import { logger } from './misc';
8-
97
interface ConsoleInterceptorOptions {
108
silent?: boolean;
119
capture?: boolean;
@@ -46,7 +44,7 @@ export class ConsoleInterceptor {
4644

4745
start(): void {
4846
if (this.options.debug) {
49-
logger.debug('Starting console output interception');
47+
this.originalConsole.error('AgentCLI Starting console output interception');
5048
}
5149

5250
console.log = this.createInterceptor(this.originalConsole.log);
@@ -64,7 +62,7 @@ export class ConsoleInterceptor {
6462
console.debug = this.originalConsole.debug;
6563

6664
if (this.options.debug) {
67-
logger.debug('Console output interception stopped');
65+
this.originalConsole.error('AgentCLI Console output interception stopped');
6866
}
6967
}
7068

@@ -99,7 +97,7 @@ export class ConsoleInterceptor {
9997
}
10098

10199
if (this.options.debug) {
102-
logger.debug(`[Intercepted]: ${message}`);
100+
this.originalConsole.error(`AgentCLI [Intercepted]: ${message}`);
103101
}
104102

105103
if (!this.options.silent) {

0 commit comments

Comments
 (0)