You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Web GUI: closing the workflow runner modal mid-workflow leaves the session hanging — wire abort-on-close and session cleanup #24
Closing the workflow runner modal (Escape key or the ✕ button) while the session waits for user input does not tell the server anything. The session stays alive in waiting_ask / waiting_notify / waiting_notice forever: the workflow never completes, the file is never launched, and nothing records the abandonment. The user believes they cancelled; the backend holds a dangling interactive session.
Reproduction
Configure a workflow that pauses on user input (e.g. a step with ask: or notify with wait: true).
Launch a matching file in the web UI — the modal opens and waits.
Press Escape or click ✕.
Actual: the modal closes; server-side the session stays in its waiting state indefinitely. Reopening the launcher creates a new session — the old one is orphaned in memory.
Expected: closing the modal while the session is interactive aborts the session server-side (equivalent to the "No / Abort Launch" path), and finished sessions are eventually cleaned up.
The Escape handler (~lines 168–178) and the ✕ button both just call onClose().
The unmount/effect cleanup (~lines 113–149) resets local state only; no session endpoint is called on close.
Backend — src/profiles/server/routes/workflow.py:
There is no abort/delete route — only POST /start, GET /{session_id} and POST /{session_id}/respond.
The in-memory store _sessions (~line 74) has no TTL or eviction: completed, aborted and orphaned sessions accumulate for the whole server lifetime.
Fix direction
Add an abort endpoint, e.g. POST /api/workflow/{session_id}/abort (or DELETE /{session_id}): mark the session aborted, set final_message = "Aborted by user (modal closed).", mark the interrupted step record accordingly.
Wire the modal to call it (fire-and-forget, errors suppressed) when it closes while the session is still interactive: Escape handler, ✕ button, and the effect cleanup for unmounts. Only for statuses running / waiting_ask / waiting_notify / waiting_notice — never for completed/aborted/failed.
Session hygiene: purge terminal sessions (completed / aborted / failed) after a TTL, and/or cap the size of _sessions, so a long-running desktop process does not accumulate them.
Tests: abort endpoint behavior (idempotent, 404 on unknown id); frontend test with vitest that closing the modal in waiting_ask triggers the abort call.
Activity
fix(workflow): single gate for notify+ask; abort session on modal clo…
feat(web): abort workflow session when the runner modal closes (#24)
chore(release): prepare 0.11.0-rc.2