Skip to content

fix(tarko-cli): prevent console interceptor recursion in debug mode#1279

Merged
ulivz merged 2 commits intomainfrom
fix/tarko-agent-cli-debug-infinite-loop
Aug 27, 2025
Merged

fix(tarko-cli): prevent console interceptor recursion in debug mode#1279
ulivz merged 2 commits intomainfrom
fix/tarko-agent-cli-debug-infinite-loop

Conversation

@ulivz
Copy link
Member

@ulivz ulivz commented Aug 27, 2025

Summary

Fixed infinite loop issue when running tarko run --headless --debug by preventing console interceptor recursion.

Root Cause: The ConsoleInterceptor used logger.debug() calls in three places:

  • start() method
  • stop() method
  • createInterceptor() method

Recursion Chain:

  1. logger.debug() internally calls console.* methods
  2. console.* methods are intercepted by ConsoleInterceptor
  3. Interceptor calls logger.debug() again
  4. Infinite recursion: logger.debug()console.*createInterceptorlogger.debug() → ...

Solution: Replace logger.debug() with this.originalConsole.error() to use the original console methods directly, avoiding interception.

Changes: Only 3 lines modified - minimal and precise fix.

Checklist

  • My change does not involve the above items.

@netlify
Copy link

netlify bot commented Aug 27, 2025

Deploy Preview for agent-tars-docs ready!

Name Link
🔨 Latest commit 205caca
🔍 Latest deploy log https://app.netlify.com/projects/agent-tars-docs/deploys/68af1344b71c890008ddb1da
😎 Deploy Preview https://deploy-preview-1279--agent-tars-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Replace logger.debug() calls with originalConsole.error() in ConsoleInterceptor
to avoid infinite recursion when debug mode is enabled.
@ulivz ulivz force-pushed the fix/tarko-agent-cli-debug-infinite-loop branch from d88d5bd to 8e351df Compare August 27, 2025 14:09
@ulivz ulivz changed the title fix(tarko): prevent infinite loop in debug mode fix(tarko): prevent console interceptor recursion in debug mode Aug 27, 2025
@ulivz ulivz merged commit 7bcff07 into main Aug 27, 2025
8 of 9 checks passed
@ulivz ulivz deleted the fix/tarko-agent-cli-debug-infinite-loop branch August 27, 2025 14:17
@ulivz ulivz changed the title fix(tarko): prevent console interceptor recursion in debug mode fix(tarko-cli): prevent console interceptor recursion in debug mode Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments