fix(init): improve multi-org error message for agentic use#974
Merged
Conversation
When --yes is set and multiple orgs are found, tell the user how to specify one via the positional syntax (sentry init <org>/) in addition to the SENTRY_ORG env var. Agents only see stderr so the actionable hint needs to be in the message itself. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
Contributor
Codecov Results 📊✅ 6975 passed | Total: 6975 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ❌ Patch coverage is 0.00%. Project has 14092 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 77.07% 77.13% +0.06%
==========================================
Files 320 320 —
Lines 61664 61615 -49
Branches 0 0 —
==========================================
+ Hits 47526 47523 -3
- Misses 14138 14092 -46
- Partials 0 0 —Generated by Codecov Action |
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.
When
--yesis set and the user has multiple orgs, the wizard currently hard-fails with:That's a dead-end for agents — they read stderr and retry, but the message doesn't tell them how to retry. This adds the positional syntax to the hint so agents can act on it immediately:
All 7 occurrences in CLI-Z1 are the same user running
sentry initvia claude-code/cursor/codex with--yesand 8 orgs. No interactive users have hit this.Test plan
sentry init --yesas a user with 2+ orgs and no existing Sentry config → see updated messagesentry init <org-slug>/ --yes→ succeeds (unchanged)SENTRY_ORG=<org-slug> sentry init --yes→ succeeds (unchanged)Fixes CLI-Z1