Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces burst pressure on the /rep/session-key endpoint by deduplicating concurrent getSecure() calls in the SDK, and slightly increases the gateway’s default session key rate limit to better tolerate short tab-open bursts. It also adds a small repo-hygiene ignore for local worktrees.
Changes:
- SDK: coalesce concurrent sensitive-variable loads behind a shared in-flight promise, with retry-after-failure behavior.
- SDK: add regression tests validating request coalescing and retry behavior.
- Gateway/docs: raise default
session-key-max-ratefrom 10 → 15 and keep defaults aligned across config, manifest, and README.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sdk/src/index.ts | Introduces shared in-flight sensitive load promise and factors sensitive loading into a helper. |
| sdk/src/tests/index.test.ts | Adds tests for coalesced concurrent calls and retry-after-failure. |
| gateway/internal/manifest/manifest.go | Bumps manifest default session-key max rate to 15. |
| gateway/internal/config/config.go | Bumps config default session-key max rate to 15. |
| gateway/internal/config/config_test.go | Updates default parsing test to expect 15. |
| gateway/README.md | Updates documented default to 15. |
| .gitignore | Ignores .worktrees/ directories. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Mar 16, 2026
Merged
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.
Summary
getSecure()calls in the SDK so one page only issues one/rep/session-keyfetch during startup.worktrees/so local worktree directories do not pollute repo statusProblem
Opening multiple browser tabs at once could trigger multiple concurrent
getSecure()calls per page before the SDK had populated its in-memory sensitive cache. That produced an avoidable burst of/rep/session-keyrequests and could push clients into429 Too Many Requestsresponses even under fairly normal usage.Changes
SDK
getSecure()callers await the same fetch/decrypt cycleGateway
session-key-max-ratefrom10to15Repo hygiene
.worktrees/to.gitignoreTesting
Notes
get()contract and only affects async sensitive-variable loading.