feat(config): add XDG and GOG path overrides#634
Conversation
|
Codex review: needs changes before merge. Latest ClawSweeper review: 2026-05-22 13:48 UTC / May 22, 2026, 9:48 AM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. for the review findings: source inspection of PR head shows the early PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge Security Review findings
Review detailsBest possible solution: Land the path model only after the remaining parser and migration blockers are fixed, with focused regression tests and explicit maintainer compatibility signoff for the upgrade behavior. Do we have a high-confidence way to reproduce the issue? Yes for the review findings: source inspection of PR head shows the early Is this the best way to solve the issue? No; the path model is directionally useful, but this branch is not yet the safest way to land it because it still needs focused parser, migration, and default-download repairs. Label justifications:
Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against f4dbfd5cbf95. |
|
ClawSweeper PR egg 🔥 Warming up: real-behavior proof passed; findings, security review, or rank-up moves are still in progress. Hatch commandComment Hatchability rules:
What is this egg doing here?
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 30f5d455d5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| func globalFlagTakesValue(flag string) bool { | ||
| switch flag { | ||
| case "--color", "--account", "--acct", "--client", "--enable-commands", "--disable-commands", "--select", "--pick", "--project", "-a": | ||
| case "--color", "--account", "--acct", "--client", "--enable-commands", "--disable-commands", "--select", "--pick", "--project", "--home", "-a": | ||
| return true |
There was a problem hiding this comment.
Include --access-token when pre-scanning --home args
preScanHomeArg depends on globalFlagTakesValue to skip values for earlier global flags, but --access-token is missing from this list. With inputs like gog --access-token TOKEN --home /tmp --help, the scanner treats TOKEN as the first positional token and stops before seeing --home, so the home override is not applied before helpDescription() is built; this makes help/introspection output report the wrong config/keyring paths despite --home being provided.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 16b0311bf4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if _, primaryErr := os.Stat(primary); os.IsNotExist(primaryErr) { | ||
| if st, legacyErr := os.Stat(legacy); legacyErr == nil && st.IsDir() { | ||
| return legacy, nil | ||
| } |
There was a problem hiding this comment.
Prefer new Gmail state root for writes
When a legacy .../state/gmail-watch directory exists, this branch returns that legacy directory instead of the new state root, so newGmailWatchStore(...).Save() keeps writing watch files to the old config tree indefinitely. In an upgraded install, this prevents migration to the new state location and contradicts the documented "legacy read fallback" behavior (new writes should land in the new path).
Useful? React with 👍 / 👎.
16b0311 to
f22d03e
Compare
|
Thank you @steipete for your relentless dedication and effort to improve the projects and the world around you! Danke schön! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa25a78977
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if strings.HasPrefix(arg, "-") { | ||
| if globalFlagTakesValue(arg) && i+1 < len(args) { | ||
| i++ | ||
| } |
There was a problem hiding this comment.
Restrict pre-scan to true global flag positions
preScanHomeArg() skips values only for flags listed in globalFlagTakesValue, so any subcommand flag value token is still scanned as if it were a top-level flag. With inputs like gog gmail send --subject --home --to [email protected] --body hi, --home is the subject value but this pre-scan treats it as a global --home override and tries to use --to as the path, causing an early usage error before normal parsing. This makes valid commands fail whenever a subcommand value is literally --home or --home=....
Useful? React with 👍 / 👎.
Summary
This PR implements the #621/#622 path model as one change:
GOG_HOME, per-kindGOG_CONFIG_DIR,GOG_DATA_DIR,GOG_STATE_DIR,GOG_CACHE_DIR, and global--home.GOG_HOME/per-kind overrides isolated so CI, containers, and agents do not silently import host secrets/state.Compatibility notes
GOG_*_DIRand--homevalues are rejected; relative XDG values are ignored per XDG expectations.--homeapplies before parser/help rendering even when placed after a subcommand.Proof
make cigo test ./internal/config ./internal/secrets ./internal/cmd ./internal/googleapi ./internal/backup ./internal/trackingmake lintGOOS=windows GOARCH=amd64 go test -c ./internal/tracking -o /tmp/gogcli-tracking-windows.test.exeGOOS=windows GOARCH=amd64 .tools/golangci-lint run ./internal/trackingtest,worker,windows, anddarwin-cgo-buildall greenGOG_HOMEwrites credentials metadata toGOG_HOME/data, config path toGOG_HOME/config, keepsclient_secretout of metadata, and lists the keyring-backed client/Users/steipete/Projects/agent-scripts/skills/autoreview/scripts/autoreview --mode branch --base origin/mainclean, no accepted/actionable findingsCloses #621.
Closes #622.
Thanks @alexminza for the original proposal and direction.