Repository navigation
fix(source): cookie-only source with --skip-local-storage and --skip-secrets - #153
Merged
Merged
Conversation
Every push packs the source profile's Local Storage leveldb into the envelope, and the watcher also pushes on Local Storage writes. A Linux sink (or any sink with skip_chrome_sqlite) never applies it. On one Mac the directory was 64 MB, so each push was ~90 MB (150 GB uploaded in 16.5 h), and slow uplinks overran the watcher's 60 s push budget. --skip-local-storage (or AGENTCOOKIE_SKIP_LOCAL_STORAGE=1 for a LaunchAgent) skips the pack and stops watching the directory. Default behavior, source.yaml keys and the wire format are unchanged. Refs #149
…ndexedDB Addresses review on #150: the default-push case clears an inherited AGENTCOOKIE_SKIP_LOCAL_STORAGE, the test compares whole Cookies slices instead of hosts, and the FAQ notes IndexedDB stays opt-in.
A normal source always loaded the secrets bus and shipped it to every push sink and, through GET /pull, to every paired teammate. Owners who keep tokens in a password manager had no way to say "never ship secrets from this source" short of running a CDP source. agentcookie source --skip-secrets (or AGENTCOOKIE_SKIP_SECRETS) skips loadSecretsPayload on every push and, in --watch, starts neither the secrets-bus watcher nor the discovery watcher, so no manifest or carried file is read. The env var fails closed: any value other than empty or 0 turns it on, and an unusual value warns once. Source state records whether the last push skipped secrets and how many CLIs it shipped, and doctor reports it as "Secrets push". Docs cover the cookie-only recipe and note that the switch does not remove secrets already delivered. Requested by @jnyross in #151. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LgVWtkXgDGWMh6L95d8piN
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LgVWtkXgDGWMh6L95d8piN
A --dry-run cycle sends nothing, but it overwrote the recorded secrets summary, so doctor could say "shipping N cli(s)" for secrets that never left the machine. Dry runs now leave it alone. The skip switch helpers move to source_skip.go to keep source.go from growing. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LgVWtkXgDGWMh6L95d8piN
6 tasks done
[Medium impact] The PR appears safe to merge; no blocking issues remain. SummaryAdds
Reviews (4) · Last reviewed commit: "fix(source): carry the saved secrets sum..." · Reviewed by Greptile |
…shing Addresses review feedback on #153. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LgVWtkXgDGWMh6L95d8piN
4 tasks done
…y-mode # Conflicts: # CHANGELOG.md
Addresses review feedback on #153. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LgVWtkXgDGWMh6L95d8piN
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
A normal source can now run cookie-only.
--skip-local-storagestops each push from carrying the browser's Local Storage leveldb, and--skip-secretsstops the source from reading the secrets bus at all. Before this, the only cookie-only route wascdp_source, which needs a second Chrome running with a debug port.--skip-local-storage(orAGENTCOOKIE_SKIP_LOCAL_STORAGE=1) is feat(source): add --skip-local-storage to stop shipping Local Storage #150 by @Dannyxlm, cherry-picked with both commits and their authorship intact. On the reporter's Mac it took each push from about 90 MB to about 1.8 MB with the same cookies delivered. A Linux sink never applied that Local Storage anyway.--skip-secrets(orAGENTCOOKIE_SKIP_SECRETS) skipsloadSecretsPayloadon every push. In--watchit also starts neither the secrets-bus watcher nor the discovery watcher, so no manifest or carried file is read. Push sinks and teammates pullingGET /pullreceive no secrets.0turns it on, and a value other than1warns once naming it. A typo such astruecannot keep shipping credentials.agentcookie doctorgains a "Secrets push" line ("skipped" or "shipping N cli(s)"), recorded from the last real push. A--dry-runleaves it alone.Supersedes #150. Its two commits are kept on this branch with @Dannyxlm as author.
Co-authored-by: Dannyxlm [email protected]
Closes #151 (requested by @jnyross).
Related: #149 (item 1; items 2 to 4 are in the push-cadence PR and #152)
Verified
go build ./...go vet ./...go test -race ./...golangci-lintv2.11.4 (the CI pin): 0 issuesThe tests swap the secrets loader for a stub that fails the test if it is called. They check:
1, neither the envelope nor the/pullcache carries a secrets fieldtrueandnoskip and warn once, while0and empty do not skipsource-state.jsonreads back as not skippedCode review:
ce-code-reviewat full depth, with correctness, security, testing and maintainability reviewers plus an independent Codex adversarial read (gpt-6-luna, independence verified).source_skip.go.Notes
No
source.yamlkey is added;TestSourceConfigYAMLKeysUnchangedForOlderBinariesguards that file. The wire format is unchanged: the skipped tarball and secrets fields are just empty. Without either flag nothing changes.🤖 Generated with Claude Code
https://claude.ai/code/session_01LgVWtkXgDGWMh6L95d8piN