Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
edstem-mcp | e4308ca | Commit Preview URL Branch Preview URL |
Oct 08 2026, 08:03 AM |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d403eb49f5
ℹ️ 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".
| async function onboardToken(ui: Ui, tokenFile: string, verify: (token: string) => Promise<EdClient>): Promise<string> { | ||
| async function onboardToken(ui: Ui, tokenFile: string, verify: CliRuntime["createClientForToken"]): Promise<void> { | ||
| showWordmark(ui); | ||
| const region = await promptEdRegion(ui); |
There was a problem hiding this comment.
Honor EDSTEM_REGION during first-run onboarding
When an interactive first-run command has EDSTEM_REGION set but no token, onboarding always prompts for a region and verifies the token against that selection. Immediately afterward, loadTokenWithSource() reapplies the environment region; if the user selects a different region, the token is successfully verified against one endpoint and then used against another, causing the original command to fail authentication. Resolve EDSTEM_REGION before prompting, as the explicit auth login path already does.
Useful? React with 👍 / 👎.
|
Closing as superseded by the released v0.8.0 implementation, rather than merging this older branch. Compared the release tag and current main against this PR: regional token persistence and CLI/stdio MCP routing are present, and later commits implement the remaining features: 5d3f835 (atomic credential saves; the atomic-save regression test matches this PR), 7f54760 (system-default-browser token setup and manual fallback), 06085b0 (login/onboarding recovery and environment override warnings), and 706d3d2 (override warnings during dry runs). v0.8.0 also adds automatic region detection and region-source reporting. The implementations are not identical commits, but this PR no longer has a feature that needs merging; merging it would reintroduce an older login flow. Release: https://github.com/bunizao/edstem-cli/releases/tag/v0.8.0 . Keeping the branch for traceability. |
Ed uses separate AU, US, and EU API endpoints, but login previously saved only the token and subsequent commands defaulted to AU. Login now selects the region, opens its token settings page through the system default browser, verifies the pasted token, and saves the token and region together for the CLI and local stdio MCP server.
--region au|us|eufor scripted login andEDSTEM_REGIONfor environment credentials; retain legacy plain-text token files with the AU default and explicitEDSTEM_BASE_URLoverrides.https://edstem.org/<region>/settings/api-tokensusing native URL launchers on macOS, Windows, and Linux. Always show the interactive token-page link. Browser profiles and sessions stay under the user's control.--no-browser, stdin login, non-interactive login, and dry runs.Validation:
npm run check, all 257 tests (225Node,22remote,10Worker),npm run build:local, skill regeneration, andgit diff --checkpassed. Tests cover regional routing, native launcher arguments, recovery/cancellation in explicit login and first-run onboarding, environment warnings, stdin failure behavior, write/sync/rename fault injection, owner-only permissions, and concurrent saves. API and launcher behavior is mocked. The AU token page was separately verified in an existing signed-in Chrome Work profile. No full live CLI-to-browser smoke test or live token creation was performed.