Steps to reproduce
- Start the automation server with a cookie file:
touch cookies.tsv # empty file, TSV format
moli serve --port 9333 --cookie-file cookies.tsv
- Via CDP: navigate to any page, then
Network.setCookie {name: "c1", value: "v1", url: "http://127.0.0.1/..."} — returns success: true, and the cookie is visible via document.cookie.
- Also set a cookie from JS:
document.cookie = 'c2=v2; path=/' — visible in-session.
- SIGTERM the server (graceful exit) and inspect
cookies.tsv.
Expected
Both cookies are persisted, as page-network-stack Set-Cookie cookies are.
Actual
cookies.tsv is empty after the graceful exit — CDP-injected and JS-set cookies are both lost. Network-stack Set-Cookie cookies from page loads persist correctly, so the persistence layer itself works.
Impact
Agent login flows that seed cookies via CDP lose state across restarts.
Suggestion
Route CDP-injected and document.cookie writes through the same persistence path as network-stack Set-Cookie.
Environment
- moli 1.1.10 (9b2f86b), Linux, serve + CDP
Steps to reproduce
Network.setCookie {name: "c1", value: "v1", url: "http://127.0.0.1/..."}— returnssuccess: true, and the cookie is visible viadocument.cookie.document.cookie = 'c2=v2; path=/'— visible in-session.cookies.tsv.Expected
Both cookies are persisted, as page-network-stack
Set-Cookiecookies are.Actual
cookies.tsvis empty after the graceful exit — CDP-injected and JS-set cookies are both lost. Network-stackSet-Cookiecookies from page loads persist correctly, so the persistence layer itself works.Impact
Agent login flows that seed cookies via CDP lose state across restarts.
Suggestion
Route CDP-injected and
document.cookiewrites through the same persistence path as network-stack Set-Cookie.Environment