Repository navigation
Conversation
…e SDK Replace raw HTTP calls with SDK client methods: - contexts/delete.ts: use client.contexts.delete() - contexts/update.ts: use client.contexts.update() - extensions/delete.ts: use client.extensions.delete() Also add success telemetry to withBrowserbaseApi to preserve requestHadHttpResponse tracking that raw HTTP calls had. Co-authored-by: Shrey Pandya <shrey150@yahoo.com>
|
This was referenced Nov 19, 2026
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Architecture diagram
sequenceDiagram
participant CLI as CLI Command
participant Resolver as Context Resolver
participant API as Browserbase API Lib
participant Client as SDK Client
participant Remote as Browserbase Remote API
participant Telemetry as Run Telemetry
Note over CLI,Remote: Contexts Delete Flow
CLI->>Resolver: resolveContextRefOrFail(args.id)
Resolver-->>CLI: context id
CLI->>API: createBrowserbaseClient(toApiOptions(flags))
API-->>CLI: client
CLI->>API: withBrowserbaseApi("contexts", () => client.contexts.delete(id))
API->>Client: client.contexts.delete(id)
Client->>Remote: DELETE /v1/contexts/{id}
Remote-->>Client: 200 OK
Client-->>API: success
API->>Telemetry: setRunTelemetryCompletion({requestHadHttpResponse: true})
API-->>CLI: success
CLI->>CLI: removeContextAliasesById(id)
Note over CLI,Remote: Contexts Update Flow
CLI->>Resolver: resolveContextRefOrFail(args.id)
Resolver-->>CLI: context id
CLI->>API: createBrowserbaseClient(toApiOptions(flags))
API-->>CLI: client
CLI->>API: withBrowserbaseApi("contexts", () => client.contexts.update(id))
API->>Client: client.contexts.update(id)
Client->>Remote: PUT /v1/contexts/{id}
Remote-->>Client: updated context
Client-->>API: result
API->>Telemetry: setRunTelemetryCompletion({requestHadHttpResponse: true})
API-->>CLI: result
CLI->>CLI: outputJson(result)
Note over CLI,Remote: Extensions Delete Flow
CLI->>API: createBrowserbaseClient(toApiOptions(flags))
API-->>CLI: client
CLI->>API: withBrowserbaseApi("extensions", () => client.extensions.delete(args.id))
API->>Client: client.extensions.delete(args.id)
Client->>Remote: DELETE /v1/extensions/{id}
Remote-->>Client: 200 OK
Client-->>API: success
API->>Telemetry: setRunTelemetryCompletion({requestHadHttpResponse: true})
API-->>CLI: success
CLI->>CLI: outputJson({ok: true, id: args.id})
alt Error Response
Client-->>API: throws
API->>API: rethrowBrowserbaseApiError(error, command)
API-->>CLI: rethrows error
end
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Set httpStatus: 200 for successful SDK calls to maintain telemetry parity with raw HTTP calls that recorded response.status. Co-authored-by: Shrey Pandya <shrey150@yahoo.com>
This branch has not been deployed
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
Migrates contexts and extensions commands from raw HTTP calls to the Browserbase SDK client methods.
Changes
contexts/delete.ts→client.contexts.delete(id)contexts/update.ts→client.contexts.update(id)extensions/delete.ts→client.extensions.delete(id)api.ts→ Add success telemetry towithBrowserbaseApito preserverequestHadHttpResponsetrackingStack
Summary by cubic
Migrates the CLI's
contextsandextensionscommands from raw HTTP calls to the Browserbase SDK client methods.contexts deleteandcontexts updatenow useclient.contexts.deleteandclient.contexts.update.extensions deletenow usesclient.extensions.delete.withBrowserbaseApinow setsrequestHadHttpResponse: trueandhttpStatus: 200on success so telemetry tracking from the old raw HTTP calls is preserved.Written for commit 179f4bb. Summary will update on new commits.