Skip to content

fix: capture editor launch output and expose view_log tool (issue #106)#107

Open
twinlunarstarz-dev wants to merge 1 commit into
Coding-Solo:mainfrom
twinlunarstarz-dev:fix/issue-106-pass-launch-errors-to-ai
Open

fix: capture editor launch output and expose view_log tool (issue #106)#107
twinlunarstarz-dev wants to merge 1 commit into
Coding-Solo:mainfrom
twinlunarstarz-dev:fix/issue-106-pass-launch-errors-to-ai

Conversation

@twinlunarstarz-dev
Copy link
Copy Markdown

Summary

Fixes issue #106 — Godot editor launch errors (e.g., parse errors) were invisible to the AI consumer because launch_editor only returned "launched successfully" without capturing console output.

Changes Made (src/index.ts)

1. Added in-memory log buffer

  • New field editorLogLines: string[] on GodotServer class stores stdout/stderr lines from editor launches (non-persistent, cleared on new launch).

2. Modified handleLaunchEditor

  • Pipes child process stdout and stderr into the editorLogLines buffer line-by-line with [stdout]/[stderr] prefixes.
  • Returns immediately after spawning instead of waiting for first output or timing out (prevents timeout on slow startups).

3. New view_log tool

  • Accepts optional lineCount parameter (default: 50, max: 1000).
  • Returns trailing lines from the log buffer so the AI can inspect what Godot printed during startup.

Direct Modifications

Location Change
~Line 238+ Added editorLogLines field to class
~Line 1046-1057 (handleLaunchEditor) Replaced wait/timeout logic with immediate return + stdout/stderr piping into buffer
~Line 90 (tool definitions) Added new view_log tool schema with lineCount parameter and description
~Line 234-261 (switch handler) Added case for "view_log" routing to handleViewLog, removed unused "get_debug_output"/"stop_project" cases, updated default error message
New method (~line 1059+) Implemented handleViewLog() — validates lineCount param and returns trailing lines as [stdout].../[stderr]... prefixed text

Testing

  • Tested on a local Godot project: editor launched without issues, no apparent functionality was lost.
  • The new view_log tool successfully captures startup output (engine version, GPU info) immediately after launch_editor.
  • No duplicate instances were spawned during testing.

Note: I do not have extensive TypeScript knowledge — please inspect the code changes carefully to verify correctness and ensure no edge cases are missed.

…ing-Solo#106)

- Add editorLogLines buffer to GodotServer class for capturing stdout/stderr during editor launches
- Modify handleLaunchEditor to pipe process output into log buffer with [stdout]/[stderr] prefixes
- Return immediately after spawn instead of waiting, preventing timeout on slow startups
- Add new view_log tool that returns configurable number of trailing lines from the log buffer (default 50, max 1000)
- Update launch_editor return message to prompt AI to use view_log for checking startup errors

This fixes issue Coding-Solo#106 where parse errors and other Godot console output during editor launch were invisible to the AI consumer. Now the AI can call view_log after launch_editor to inspect what Godot printed, including ERROR lines.
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