still working on crashes

This commit is contained in:
2026-04-08 01:42:00 -06:00
parent 2406b0a2e7
commit 1e02bf32d9
8 changed files with 203 additions and 30 deletions

View File

@ -17,8 +17,10 @@ from routers import transcribe, export, ai, captions, audio
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
# Dev log file — frontend forwards console.error/warn here so the agent can read it
DEV_LOG_PATH = Path(__file__).parent.parent / "webview.log"
# Dev log file — keep outside workspace to avoid dev watcher reload loops.
DEV_LOG_PATH = Path(
os.environ.get("TALKEDIT_DEV_LOG_PATH", str(Path(tempfile.gettempdir()) / "talkedit-webview.log"))
)
@asynccontextmanager
@ -205,6 +207,7 @@ async def dev_log(request: Request):
if args:
line += " " + " ".join(args)
line += "\n"
DEV_LOG_PATH.parent.mkdir(parents=True, exist_ok=True)
with open(DEV_LOG_PATH, "a") as f:
f.write(line)
return {"ok": True}
return {"ok": True, "path": str(DEV_LOG_PATH)}