mirror of https://github.com/garrytan/gstack.git
The debounced auto-cookie checkpoint had two gaps. First, the trigger set was a hand-maintained list that missed the actual cookie-mutating commands (cookie, cookie-import, load-html) while listing a non-existent set-cookie. Drive the decision off WRITE_COMMANDS (the real mutator registry) plus a small extra set for js/eval and the meta commands (chain, state, newtab, tab-each) that can change the cookie jar. Second, the schedule call ran before dispatch, so a slow navigation or login redirect snapshotted the pre-command jar; move it to after the command attempt (success and error paths, plus the scoped-newtab early return) so the debounce captures the post-mutation state. Also wire cookie-picker import/remove: those flow through the /cookie-picker route, not /command, so they never scheduled a save. Pass scheduleAutoCookieCheckpoint as an onCookieMutation callback and fire it after addCookies / removal. Serialize checkpoints with an in-flight promise guard so an overlapping periodic + debounced + shutdown checkpoint can't race two concurrent saveAutoCookieState writes onto the same slot. The shutdown flush awaits any in-flight checkpoint first, then runs its own, so no save is lost. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| bin | ||
| scripts | ||
| src | ||
| test | ||
| PLAN-snapshot-dropdown-interactive.md | ||
| SKILL.md | ||
| SKILL.md.tmpl | ||