Repository navigation
chore: restore edstem update, retry rate limits, and drop dead code - #13
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
edstem-mcp | 14dba40 | Commit Preview URL Branch Preview URL |
Sep 19 2026, 11:08 AM |
Wire src/update.ts into a top-level mutating command that reports the npm registry version and upgrades when one is available. mutationAction no longer builds an Ed client, so update runs without a token.
GET requests now retry on 429/502/503/504 with exponential backoff and an honored Retry-After header. Writes are never retried. loadConfig reads the rateLimit block that config.yaml already declared.
resolveCourseId and the commands that follow it each hit /api/user. Share one in-flight promise per client and cache the result briefly; failures are not cached.
src/ed/projections.ts replaced it; only its own test imported it.
edstem-mcp used to start a stdio server for any argument, so --help hung in a terminal.
Also report the command that ran instead of a derived boolean.
bunizao
force-pushed
the
chore/cleanup-update-retry
branch
from
September 19, 2026 11:07
cb0130a to
14dba40
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.
Cleanup pass over the CLI and Ed client: the promised
edstem updatecommand, read retries, one fewer/api/userround trip, a dead module removed, and a usableedstem-mcp --help.Changes
edstem update:src/update.tswas dead code despite CHANGELOG 0.3.1 promising the command. It is now a top-level mutating command.--checkreports{currentVersion, latestVersion, updateAvailable, upgradeCommand}; without it, an available update is confirmed through the usual plan/--yes/--dry-runflow and then installed withnpm install -g edstem-cli@latest.mutationActionno longer builds an Ed client, so updating does not require a token.EdClient.requestretries GET on 429/502/503/504 with exponential backoff (retryBaseDelayMs * 2^attempt), honoring a largerRetry-Afterheader, up tomaxRetries. POST and PUT are never retried.loadConfignow reads therateLimit.maxRetriesandrateLimit.retryBaseDelayblock thatconfig.yamlalready declared, wired through the CLI runtime and the stdio MCP server. The unusedrequestDelayandmaxCountkeys were dropped fromconfig.yaml.fetchUser()caches per client instance for 60 seconds and shares an in-flight promise; a failed fetch is not cached.resolveCourseIdplus the command that follows it used to hit/api/usertwice.src/ed/serialization.ts(and its test).src/ed/projections.tsreplaced it; nothing else imported it.edstem-mcp --help/--versionnow print usage and the version instead of silently starting a stdio server that hangs in a terminal.Tests
npm run check,npm run test:node(82 passing),npm run build:local,npm run skill:generateall clean;SKILL.mdregenerated for the new command.New coverage:
update --checkand--dry-runagainst a mocked registry withspawnSyncasserted unused, the confirmed install path, retry behaviour (429 then 200,Retry-Afterhonored, POST not retried, give-up aftermaxRetries) via the injectedsleep,rateLimitconfig parsing, and thefetchUsermemo (shared call, TTL expiry with fake timers, failure not cached). No request ever reaches the real Ed API.