-
Notifications
You must be signed in to change notification settings - Fork 2.6k
ContextProxy fix - constructor should not be async #1579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 80d1fae The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
.github/workflows/code-qa.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this file for consistency.
|
The pull request involves changes across multiple areas, including CI updates, refactoring, and test updates. While these changes contribute to a common goal of improving the codebase, they span different areas of the project. Consider splitting the pull request into smaller, more focused pull requests if the changes are not tightly interconnected. For example, CI updates could be separated from refactoring tasks, and test updates could be handled in a separate pull request. This approach can help streamline the review process and ensure each set of changes receives the attention it deserves. |
src/api/providers/openrouter.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We log this too much (it's really noisy in the evals). Let's only log an error if all attempts fail.
src/exports/roo-code.d.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a generated file? Or are we going to need to remember to keep it up to date?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be full type safety, so you will be forced to keep this up to date. This is intended to the be the source of truth, and is not generated. If you're noticing the redundancy between this type and the SECRET_KEYS constant, you can see how I handle the out-of-date problem with the following:
type CheckSecretKeysExhaustiveness = Exclude<SecretKey, (typeof SECRET_KEYS)[number]> extends never ? true : false
const _checkSecretKeysExhaustiveness: CheckSecretKeysExhaustiveness = trueThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(If you know of a better way to enumerate the possible keys without placing a constant in the .d.ts file LMK).
00da3d4 to
c10c85e
Compare
e2e/src/suite/cancelResume.test.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, it's been flaking for me
0d46a91 to
4b6def5
Compare
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Context
I ran into an annoying race condition in the evals in which we attempt to write to the secret state while it's already being asynchronously initialized, and the values I want to write get clobbered. This is caused by the
ContextProxy's constructor kicking off an async function call w/o allowing us to await it.Additionally, I don't see a reason to allow arbitrary key names in
ContextProxy, so I added full type safety to it.I also further simplified the
RooCodeAPIwhich allowed me to clean up some of the e2e test code.Implementation
Screenshots
How to Test
Get in Touch
Important
Refactor
ContextProxyto remove async constructor, enhanceRooCodeAPIwith new methods, and update tests and configurations accordingly.ContextProxyto make constructor non-async and addinitialize()method.GlobalStateKeyandSecretKey.cancelTask()andsetConfiguration()methods.setCustomInstructions()andgetCustomInstructions().contextProxy.test.tsandClineProvider.test.tsto reflect changes inContextProxyandRooCodeAPI.subtasks.test.tsfor testing subtask cancellation and resumption..env.integrationto.env.localincode-qa.ymland related files.knip.jsonto ignoree2e/**and other paths.This description was created by
for 4b6def5. It will automatically update as commits are pushed.