feat(live): make live sessions recoverable#125
Conversation
|
Pls take a look, I spent 10% of my weekly session on it 🥹 |
nqh-packages
left a comment
There was a problem hiding this comment.
Hi, all the bugs are fixed. Please take a look. Thanks!
tired of live mode losing the plot when the browser moved faster than the agent. now the state is boring: journal it, resume it, finish it. --- - add durable live-session journal, checkpoint events, and status/resume/complete commands - split browser session storage into a testable helper and harden accept/discard completion - fix Astro live CSS preview mode and add recovery/live E2E coverage - declare Bun as the package manager and add a Bun-native audit script
4a0dc7d to
21617e8
Compare
|
I have some plans for a new .impeccable directory, so making some changes directly to this branch to align with it. Stay tuned! this is solid work, I'll get it merged soon, thanks for your contribution 🙏 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 16c207b. Configure here.
- Detector: italic-serif display heroes and hero eyebrow chips (#129, contributed by @vinaypokharkar). - Live mode: durable session journal, status/resume/complete commands (#125, contributed by @nqh-packages). - Reference files: stripped "Remember:" closer chants, brochure-style openers (12 files), and 419 em-dashes. Less context per command load, less repetition the model reads past. Refresh harness output dirs and plugin/ subtree. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

feat: recover live sessions after missed agent/browser handoffs
Why
live mode could lose the plot if the browser moved ahead while the agent was not polling.
accept, discard, reload, helper restart: all of those had enough state in different places, but no single durable trail to resume from.
this makes the workflow less fragile. browser state is no longer just vibes in localStorage and chat history.
What changed
.impeccable-live/sessionsJSONL journal with rebuildable snapshots./polldelivery to lease events until the agent acknowledges them.live-status.mjs,live-resume.mjs, andlive-complete.mjsfor recovery.live-browser-session.jsso it can be tested without booting the full overlay.SAVINGuntil the server receives it.astro-global-prefixedoutput and E2E coverage.packageManager: [email protected]and a Bun-nativeauditscript.How to verify
node --test tests/live-wrap.test.mjsnode --test tests/live-session-store.test.mjsnode --test tests/live-browser-session.test.mjsnode --test tests/live-recovery-commands.test.mjsnode --test tests/live-server.test.mjsbun run buildPATH="/opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH" GIT_CONFIG_GLOBAL=/dev/null bun run testPATH="/opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH" GIT_CONFIG_GLOBAL=/dev/null IMPECCABLE_E2E_ONLY=astro-vite7 bun run test:live-e2eKnown follow-up
bun run auditnow runs against the real Bun lockfile, but it currently fails on transitive advisories fromarchiverand optionalpuppeteer. I left that honest instead of adding ignores before deciding whether to replace those dependency paths.Note
Medium Risk
Refactors live-mode session lifecycle (polling, accept/discard, and state persistence) and adds a new durable journal/recovery commands, which could affect in-progress sessions and cleanup flows if edge cases are missed.
Overview
Live mode sessions are now durably recoverable: the helper persists an append-only journal under
.impeccable/live/sessions/, replays unacknowledged work after restart, andpolldelivery now uses leased events that require an explicit agent acknowledgement.The browser overlay now emits periodic
checkpointevents (variant/phase/param values), preserves local session state across transient server loss, and hardensaccept/discardby showing aSAVINGstate and only marking sessions handled after the helper confirms receipt.Adds recovery tooling (
live-status.mjs,live-resume.mjs,live-complete.mjs) plus shared path helpers inimpeccable-paths.mjs, updates the design sidecar location to.impeccable/design.json(with legacy fallbacks), and enhanceslive-wrap.mjsto return per-file CSS authoring mode (including an Astroastro-global-prefixedpreview mode).Reviewed by Cursor Bugbot for commit 1064bfd. Bugbot is set up for automated code reviews on this repo. Configure here.