• Stefy Lanza (nextime / spora )'s avatar
    logging: durable request-debug sink + non-silent engine log pump · ced55385
    Stefy Lanza (nextime / spora ) authored
    Fixes "embedding request debug on radeon disappeared" — a real regression
    where the radeon engine stopped emitting ALL log output the instant it
    finished loading its GGUF embedders (~13s after launch), while still serving,
    so its FULL REQUEST DEBUG + thermal debug vanished with no trace.
    
    Two changes:
    
    1) codai/api/log.py — the log_requests middleware now ALSO appends each
       FULL REQUEST DEBUG block, from the engine's own process, straight to
       <dir(CODERAI_LOG_FILE)>/requests.log via a single atomic O_APPEND write
       (tagged [ts][engine] from CODERAI_ENGINE_NAME). This survives the engine's
       stdout stream dying, so request bodies are captured regardless. Concurrent
       engines never interleave mid-block.
    
    2) codai/frontproxy/engine_supervisor.py — _pump_logs no longer dies silently:
       a bad line can't kill the pump, and on stream end it prints
       "[pump] log stream ended (<stdout EOF|pump error>); engine still ALIVE/exited"
       so a vanishing engine log stream is diagnosable instead of looking like
       "debug turned off".
    Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01R6iugoNeEgt9PkajKrFyq4
    ced55385
engine_supervisor.py 60.9 KB