• Stefy Lanza (nextime / spora )'s avatar
    engine: stop event-loop freeze from huge --debug dumps; name processes by role · fd715097
    Stefy Lanza (nextime / spora ) authored
    Root cause of "engine 'nvidia' not responding" during generation: in --debug
    mode the streaming response generator print()s the ENTIRE generated text (raw
    + repr), and a prompt-echoing/runaway generation makes that multi-MB. The
    engine writes stdout to a pipe drained by the front; once the pipe fills, that
    synchronous print() — running on the event-loop thread inside the SSE generator
    — BLOCKS, freezing the engine so health polls time out and the front flips it
    to "not responding" (seen ~3s into each debug flood in debug.log).
    
    - api/text.py: add _clip_for_log() and bound every large debug/dump print
      (generated_text, second_pass/reasoning/final text, formatted_response,
      extracted_tool_calls) to ~4KB head+tail. Shared layer, so both engines covered.
    - engine_supervisor: enlarge each engine's stdout pipe to 1 MiB (F_SETPIPE_SZ)
      so bursts can't stall the event loop even if the pump lags briefly.
    
    Also: name processes by role — coderai-front for the front, coderai-<name> for
    each engine (CODERAI_ENGINE_NAME passed at spawn), coderai for single-process.
    Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_011DDv7BchtZQWsnPG6Jm49m
    fd715097
Name
Last commit
Last update
codai Loading commit data...
docs Loading commit data...
packaging Loading commit data...
samples Loading commit data...
tests Loading commit data...
tools Loading commit data...
.dockerignore Loading commit data...
.gitignore Loading commit data...
AI.PROMPT Loading commit data...
CODERAI_API_DOCUMENTATION.md Loading commit data...
CoderAI.gif Loading commit data...
DISTRIBUTION.md Loading commit data...
LICENSE.md Loading commit data...
MULTIMODAL_CAPABILITIES.md Loading commit data...
MULTIMODAL_UI_EXAMPLES.md Loading commit data...
README.md Loading commit data...
build-oci.sh Loading commit data...
build.ps1 Loading commit data...
build.sh Loading commit data...
coderai Loading commit data...
coderai-broker-implementation-reference.md Loading commit data...
coderai-integration.md Loading commit data...
commands Loading commit data...
osxbuild.sh Loading commit data...
package-oci.sh Loading commit data...
package-tarball.sh Loading commit data...
requirements-nvidia.txt Loading commit data...
requirements-vulkan.txt Loading commit data...
requirements.txt Loading commit data...
run-oci.sh Loading commit data...
smoke-test-oci.sh Loading commit data...
todo.md Loading commit data...
video_editor.config.json Loading commit data...