[codex] Fix SDK packaging and runtime robustness#77
Open
shrisukhani wants to merge 11 commits intomainfrom
Open
[codex] Fix SDK packaging and runtime robustness#77shrisukhani wants to merge 11 commits intomainfrom
shrisukhani wants to merge 11 commits intomainfrom
Conversation
Contributor
Author
|
bugbot review |
Contributor
Author
|
@claude please review this PR and see if you can find any problems with it or it's ok to merge |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 033eb08. Configure here.
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
This PR fixes a set of SDK packaging and runtime reliability issues found during a repo-wide review.
What changed
distbefore builds and importservices/web/indexexplicitly so published root imports load the currentWebServiceimplementation.dependenciesso TypeScript consumers can compile against the published package without installing extra@types/*packages.runtimeProxyOverridehandling so an override without an explicit port does not inherit the runtime service port.401handshake, matching the HTTP runtime retry behavior.{}instead of parse failures.uploadFilepromise.stoppedas a terminal status in polling helpers and expose it in relevant job status unions.Root cause
Several issues came from drift between source and published artifacts:
tscdoes not remove stale files, and the package publishes the wholedistfolder. Runtime issues were mostly parity gaps between HTTP transport behavior and websocket transport behavior.Validation
yarn buildyarn lintyarn typecheck:testsyarn -s vitest run tests/sandbox/e2e/runtime-transport.test.ts tests/sandbox/e2e/sandbox-contract.test.ts tests/sandbox/e2e/process-api.test.tsnpm pack --dry-run --jsonnew HyperbrowserClient(...).web.crawlis presentNote: full
yarn teststill requires a local sandbox control plane athttp://localhost:8080; without it, the live e2e suites fail withECONNREFUSED.Note
Medium Risk
Touches SDK build/publish pipeline and runtime HTTP/WebSocket transport behavior (auth refresh, proxy URL rewriting, timeouts), which could affect production connectivity despite being reliability-focused.
Overview
Improves SDK publish correctness by cleaning
distbeforetsc, explicitly importingWebServiceviaservices/web/index, moving@types/*packages to runtimedependencies, and gating npm releases with a newtypecheck:testsstep.Hardens control/runtime networking by treating empty JSON responses as
{}, fixingruntimeProxyOverrideport handling, adding websocket handshake timeouts, and refreshing runtime websocket auth once on401(terminal + file watch). It also treatsstoppedas a terminal job status across scrape/crawl/extract/web jobs and removes a stream error handler that could throw outside theuploadFilepromise.Reviewed by Cursor Bugbot for commit 033eb08. Bugbot is set up for automated code reviews on this repo. Configure here.