v0.1.3 — Chromium never closed + faster startup
v0.1.3 — Chromium never closed + faster startup
Two more issues surfaced from real usage after v0.1.2.
1. Chromium (and its helper processes) never closed
session.py's _pump() set a task to COMPLETED/FAILED but never called
close() on the browser environment — only an explicit DELETE /v1/tasks/{id}
(or quitting the whole app) ever tore the browser down. Every infinia-qa run
left a Chromium process tree running forever.
Fix: close() now runs automatically at every genuinely terminal state
(COMPLETED, an exception, a failed watchdog, or step-budget exhaustion).
AWAITING_APPROVAL is untouched — that state is deliberately resumable and
needs the same live browser to stay open. Verified: watched Chromium (5+
processes) spawn mid-task and confirmed zero remain the instant a task reaches
a terminal state, across completed and failed outcomes alike.
2. ~5.5s before the app responds after every launch — now ~0.5-2.5s
Not a bug in the sense of broken logic — the frozen sidecar was a PyInstaller
onefile binary, which re-extracts its entire ~85MB payload to a fresh temp
directory on every single launch before Python can even start importing
onnxruntime/fara/playwright. Measured consistently at ~5.5s across repeated
runs, not just the first one.
Switched the freeze spec to onedir: the extracted tree now ships directly
inside the .app bundle at build time, so there's nothing to unpack at launch.
Measured: sidecar-alone cold start dropped from ~5.5s to ~0.5s after the first
run; full app-launch-to-Task-API-live dropped to ~2.5s.
Bonus: onedir also simplified signing. The old AMFI rejection this
project's signing script special-cased around (PyInstaller onefile extracting
libpython3.12.dylib to a temp dir with a Team ID mismatch under hardened
runtime) doesn't exist anymore — the dylib is now a real on-disk file signed at
build time. build-signed-dmg.sh no longer needs the separate
no-hardened-runtime re-sign pass for the sidecar.
Verified end-to-end
- Real task lifecycle: Chromium spawns mid-task, fully exits (0 processes) the
moment the task reachescompletedorfailed. open "Infinia Automate Studio.app"→ Task API live in ~2.5s (was ~5.5s+ for
the sidecar alone before).- All 232 existing sidecar tests pass.
Install (one command, no repo access)
curl -fsSL https://infinia-automation-studio.adid.dev/install.sh \
| INFINIA_TF_BASE_URL=https://api.tf-staging.iamsaif.ai/v1 \
INFINIA_TF_API_KEY=tf-your-key-here \
bash