Achen/add grok to agent setup - #1
Draft
adelechen2-stripe wants to merge 25 commits into
Draft
adelechen2-stripe wants to merge 25 commits into
adelechen2-stripe wants to merge 25 commits into
Conversation
) ## Summary `stripe agent setup` fails for Codex users whose Stripe plugin comes from `openai-api-curated`, and reports those installations as missing. Codex's default plugin list can also omit installed local curated plugins, causing a successful install to fail verification. We want to keep the official marketplace names in an array and run the existing detection and install logic in order. Query each marketplace explicitly with `plugin list --marketplace <name> --json`. Detection tries the next marketplace after a lookup failure and shows the existing upgrade hint only if neither lookup succeeds. Installation and `--force` stop at the first verified success, including verification when Codex exits 0 without installing anything. If every install attempt fails, report each marketplace's error. Simplified its - Run codex plugin marketplace list --json. - Intersect available marketplaces with openai-curated and openai-api-curated, preserving that order. - If listing fails, fall back to trying both supported marketplaces. - Detect the Stripe plugin in the selected marketplaces. Skip installation if already installed, unless --force. - When installing, try the selected marketplaces in order and stop after the first verified success. - If none are available or all attempts fail, report “could not install the Stripe plugin from openai-curated or openai-api-curated,” with the relevant reasons. Validation: - `env -u CODEX_CI -u CODEX_THREAD_ID CGO_ENABLED=0 go test -race ./pkg/agentsetup ./pkg/cmd` - `make lint` - Reproduced the false failure with real Codex CLI 0.153.4: the default list omitted an installed Stripe plugin that the marketplace-specific list found. The rebuilt Stripe CLI correctly detects it and completes a forced reinstall. - Binary fixtures verify API-marketplace fallback and that both failed attempts appear in the CLI output. Regression tests cover a failed first lookup followed by API-plugin detection, exit-zero failures, and stopping after the first successful install, including reinstalls. Testing: https://gist.github.com/markguan-stripe/331ac81dd3b18bfe7da083ba0cb05feb --------- Co-authored-by: codex <noreply@openai.com>
### Summary - Fixes the deprecation message added in stripe#2013 to reference v1.51.0 (the next release) instead of the incorrect v1.60.0 - Adds the same deprecation for `stripe status` ### Testing Tested manually ``` $ go build -o /tmp/stripe ./cmd/stripe $ /tmp/stripe status The `stripe status` command is no longer available in Stripe CLI v1.51.0 and later. To use it, install a version earlier than v1.51.0. $ /tmp/stripe samples create checkout The `stripe samples` command is no longer available in Stripe CLI v1.51.0 and later. To use it, install a version earlier than v1.51.0. $ /tmp/stripe serve . The `stripe serve` command is no longer available in Stripe CLI v1.51.0 and later. To use it, install a version earlier than v1.51.0. $ /tmp/stripe srv . The `stripe serve` command is no longer available in Stripe CLI v1.51.0 and later. To use it, install a version earlier than v1.51.0. $ /tmp/stripe status --help The `stripe status` command is no longer available in Stripe CLI v1.51.0 and later. To use it, install a version earlier than v1.51.0. $ /tmp/stripe help status The `stripe status` command is no longer available in Stripe CLI v1.51.0 and later. To use it, install a version earlier than v1.51.0. ```
### Summary `--forward-to` now requires naming a subscription, so the forwarding canary needs `--all-snapshot` to keep forwarding every snapshot event. The API canary doesn't run on pull requests, so this failure only shows up once the flag redesign lands on master. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
## Summary Throttle automatic plugin upgrade checks to once every four hours per plugin. This avoids a metadata request on every plugin command—and repeated three-second timeouts when the endpoint is unreachable—while still checking often enough to pick up upgrades during the same working session. The last-check timestamp is stored as a small RFC3339 file alongside local plugin metadata. Failed checks are throttled too, and missing, corrupt, or future-dated timestamps trigger a fresh check. ## Test plan - go test ./pkg/plugins ./pkg/cmd/plugin ./pkg/config - go vet ./pkg/plugins ./pkg/cmd/plugin ./pkg/config - Added coverage for successful, failed, expired, corrupt, unwritable, and per-plugin throttle stamps. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
## Summary Prevent installed plugins from auto-upgrading when invoked only to display help. - Route `--help`, -h, and stripe help <plugin> through a help-only execution path. - Skip the auto-upgrade check while still running or installing the plugin needed to render its help. - Preserve normal auto-upgrades for commands that perform work. - Add coverage for top-level and subcommand help flows. ## Testing - go test ./pkg/cmd ./pkg/plugins - Targeted tests under the race detector - go vet ./pkg/cmd ./pkg/plugins <img width="965" height="476" alt="Screenshot 2026-09-17 at 5 05 13 PM" src="https://github.com/user-attachments/assets/285e128b-8e8b-4e64-969a-4e0df8cd59b2" /> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
### Summary When there is no config file yet, write `config_version = 2` so the first write into it lands in the v2 layout directly. Without this, the first command writes the flat layout and the next command migrates it. This is still behind the `configV2MinimumVersions` gate, which is empty, so this does not run until stripe#2025 lands. ### Testing - [x] Added test cases - [x] Tested manually Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
### Summary A profile can be named after a CLI setting (nothing stops `stripe login --project-name installed_plugins`). Those profiles need to move under the profiles table too during the migration. This PR detects profiles by contents instead of by name: a top-level table holding a recognized profile field like `test_mode_api_key` is a profile, and gets migrated. `profiles` itself is the one name still special-cased, since in v2 it is the container. Gated on `configV2MinimumVersions`, which is empty until stripe#2025 merges, so this has no user impact until then. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
### Summary A plugin too old to read a migrated `config.toml` is refused before it starts. Once stripe#2025 lands, anyone whose plugin has not caught up gets ``` $ stripe apps list $ echo $? 1 ``` with no output at all — and the swallowed message is the only thing that would tell them what to do: ``` apps 1.0.0 cannot read this config file; run `stripe plugin upgrade apps` ``` `runPluginCmd` exits 1 without printing the error, on the grounds that the plugin already printed it — which is true only from `RunCommand` onward. This PR marks just those three post-launch returns as already-reported and prints everything else, so the user sees the message. Anything that fails before the plugin is launched is printed from now on. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
### Summary The migration printed two lines ahead of the command that triggered it: ``` checking installed plugins... 1 is compatible. ✔ updated /Users/me/cfgtest/stripe/config.toml to the new config format (backup saved to config.toml.v1.bak) ``` Neither is something the user asked for or can act on, so this PR moves them to the debug logger instead. `--log-level debug` still says which step ran or declined, and why. The error paths move to debug too, because there is nothing for the user to fix: the migration retries on their next command, and until it succeeds the config file keeps the layout their plugins already read. Otherwise this would print ahead of every command they run, indefinitely, about a state that is not costing them anything: ``` ! could not upgrade projects to the minimum required version (1.2.0). run `stripe plugin upgrade projects`, then try again. your config file was not changed. ``` The one line kept out loud is the plugin upgrade: ``` Upgrading the projects plugin so it can read the updated config file. ``` Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
…ripe#2052) ## Summary Prevent automatic plugin upgrades from overwriting plugins in a user-specified directory, whether configured through STRIPE_PLUGINS_PATH or a compiled-in PluginsPath. When automatic upgrades are skipped for an overridden directory, continue showing the standard upgrade hint so users know a newer version is available and can upgrade explicitly. ## Testing - go test ./pkg/plugins - go test -race ./pkg/plugins - go test -tags localdev ./pkg/plugins - go vet ./pkg/plugins --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
…pe#2060) Attempt to fix winget installation flakes Here's a passing run: https://github.com/stripe/stripe-cli/actions/runs/35408401079 Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
adelechen2-stripe
force-pushed
the
achen/add-grok-to-agent-setup
branch
from
September 21, 2026 17:30
0efa1d3 to
bf83daa
Compare
### Summary Adds rpcs for plugins (particularly projects) to initiate the OAuth flow themselves. The rpcs are: - OAuthInitiateLogin: kicks off the OAuth flow and returns a device code and a verification URI - OAuthCheckLoginStatus: checks whether the user has completed the OAuth flow. This doesn't poll, that's on the plugin to implement. - OAuthFindPendingLogin: looks for a pending login that's been initiated with OAuthInitiateLogin, useful for --non-interactive flows where login is started with one command and then finished with another ### Testing Tested login still works: <img width="870" height="330" alt="Screenshot 2026-09-18 at 4 33 50 PM" src="https://github.com/user-attachments/assets/db55a8d6-bb10-4329-aaf8-6888352ed6b6" /> Introduced a dummy command in projects to test that it works from a plugin: <img width="798" height="311" alt="Screenshot 2026-09-18 at 4 34 03 PM" src="https://github.com/user-attachments/assets/2bc4eed4-e9d6-422e-95cf-fe59fed5f2ec" /> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
### Summary This PR adds a GitHub Actions workflow that posts a message to slack PR channel when `stripe/developer-products` is requested to review a pull request that is ready for review.
…ipe#2067) ### Summary Brings curl-install auto-update from `v2` onto `master`. `master` already had the install scripts, `notify.sh`, `curl-install-test.yml`, and `pkg/installmethod` — this PR adds the Go implementation and wires it up. **Ported from `v2`:** | Change | Original PRs | |---|---| | `pkg/autoupdate/` (12 files, unchanged from `v2`) | stripe#1767, stripe#1768, stripe#1769, stripe#1990, stripe#1992, stripe#2041, stripe#2042 | | `cmd/stripe/main.go` — apply a pending update before the command runs, check for the next one after | stripe#1769 | | `scripts/install.sh` — install telemetry | stripe#1822 | | `.github/workflows/autoupgrade-test.yml` — the real 3-platform canary, replacing the stub that pointed at `v2` | stripe#1815, stripe#1831, stripe#1965, stripe#1988, stripe#1991 | **Adapted for `master`:** - `CheckForUpdate` is deferred rather than called at the end of `main`. `v2`'s `main` has one exit path; `master` returns early when telemetry is opted out and when the version is not semver, and the check has to run on both. - `install.sh` reports `install_method=script` rather than `curl`, matching what `pkg/installmethod` reports for the same install so installer and CLI events group together. `scripts/notify.sh` is identical on both branches and `curl-install-test.yml` is ahead on `master`, so both are untouched. ### Test plan - `go build ./...` - `go test ./pkg/autoupdate/... ./pkg/installmethod/... ./pkg/version/...` - `sh -n scripts/install.sh` - `go generate ./...` produces no diff - End to end on this branch: built at `1.50.10` into `~/.stripe/bin/stripe`, first run staged the marker, second run updated to `1.51.1` and printed `Run 'stripe version --notes' to see what's new.` --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
adelechen2-stripe
force-pushed
the
achen/add-grok-to-agent-setup
branch
from
September 22, 2026 14:04
50134c6 to
5de9f90
Compare
`stripe plugin auto-update` wrote the config field and said nothing, so there was no way to tell whether the change landed or how to reverse it. Print the resulting state along with the command that flips it back, and for a per-plugin scope also surface the global setting the plugin can fall back to. <img width="941" height="90" alt="Screenshot 2026-09-22 at 11 57 54 AM" src="https://github.com/user-attachments/assets/2507e49b-e40f-422a-9f29-cbc142e1adb0" /> ### Reviewers r? @ cc @stripe/developer-products ### Summary <!-- Simple summary of what the code does or what you have changed. If this is a visual change consider including a screenshot/gif. See go/screencap for tips/tools. --> <!-- Apply one label to this pull request: breaking-change, security, deprecation, enhancement, bug, or release-notes. Release notes are generated from it. Use skip-release-notes if this is not a user-facing change and you do not want the commit title to show up in changelogs. --> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
adelechen2-stripe
force-pushed
the
achen/add-grok-to-agent-setup
branch
from
September 22, 2026 20:20
5de9f90 to
4b37a53
Compare
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.
Reviewers
r? @
cc @stripe/developer-products
Summary