Conversation
…meral temp profile Fixes issue #606 (Root Cause A): headless-shell no longer creates a new openchrome-<Date.now()> temp directory on every launch. Instead it uses a stable path at ~/.openchrome/headless-shell-profile so cookies persist across restarts. Introduces the 'headless-shell' ProfileType to distinguish this case from the intentionally ephemeral 'temp' profile type. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes issue #606 Root Cause A: when
--headless-shellis used,profile-manager.tswas creating a new ephemeral temp directory (openchrome-<Date.now()>) on every launch, destroying all cookies between restarts.Root Cause (A)
resolveProfile()previously handleduseTempProfileandusingHeadlessShellin a single branch, giving both an ephemeralos.tmpdir()/openchrome-<Date.now()>path. SinceDate.now()changes every launch, headless-shell sessions had no persistent storage for cookies, auth tokens, or session state.Fix
resolveProfile()useTempProfilecontinues to use an ephemeralos.tmpdir()/openchrome-<Date.now()>path (intentional)usingHeadlessShellnow uses a stable path:~/.openchrome/headless-shell-profileviaos.homedir()(Windows-compatible)'headless-shell'value toProfileTypeto make the distinction explicitlauncher.tsfor the new profile typeprofileType === 'temp'for headless-shell to now expectprofileType === 'headless-shell'and verify the stable pathTest plan
tests/chrome/persistent-profile.test.ts— all 47 tests pass, including updated headless-shell testtests/chrome/launcher-launch.test.ts— all 9 tests passnpm run buildexits cleanly (zero TypeScript errors)🤖 Generated with Claude Code