• 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
..
__init__.py Loading commit data...
_film_net.py Loading commit data...
_rife_ifnet.py Loading commit data...
app.py Loading commit data...
archive.py Loading commit data...
audio_backends.py Loading commit data...
audio_clean.py Loading commit data...
audio_gen.py Loading commit data...
audio_stems.py Loading commit data...
characters.py Loading commit data...
custom_pipelines.py Loading commit data...
ds4_kv_janitor.py Loading commit data...
ds4_worker.py Loading commit data...
embeddings.py Loading commit data...
environments.py Loading commit data...
faceswap.py Loading commit data...
images.py Loading commit data...
log.py Loading commit data...
loras.py Loading commit data...
parler_worker.py Loading commit data...
pipelines.py Loading commit data...
prompt_cache.py Loading commit data...
ratelimit.py Loading commit data...
spatial.py Loading commit data...
state.py Loading commit data...
text.py Loading commit data...
transcriptions.py Loading commit data...
tts.py Loading commit data...
tts_backends.py Loading commit data...
urlutils.py Loading commit data...
video.py Loading commit data...
voice_clone.py Loading commit data...
voice_convert.py Loading commit data...