Skip to content

Delete packages/server-v4 entirely for now#2151

Merged
pirate merged 1 commit into
mainfrom
delete-server-v4
May 22, 2026
Merged

Delete packages/server-v4 entirely for now#2151
pirate merged 1 commit into
mainfrom
delete-server-v4

Conversation

@pirate
Copy link
Copy Markdown
Member

@pirate pirate commented May 20, 2026

why

New stagehand v4 will be completely different than what we have in the v4 directory.

It's currently distracting for llms / pentesters / contributors to see all this dead v4 code.

what changed

test plan


Summary by cubic

Deleted the legacy packages/server-v4 (@browserbasehq/stagehand-server-v4) package and all related files. This removes dead code to reduce noise and avoid confusion while we rebuild the Stagehand v4 server.

  • Migration
    • No functional impact; the package was private and unused.
    • Remove any references to packages/server-v4 or @browserbasehq/stagehand-server-v4 in scripts, CI, or docs if they exist.

Written for commit 4d2ca1d. Summary will update on new commits. Review in cubic

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 20, 2026

⚠️ No Changeset found

Latest commit: 4d2ca1d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 124 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant Repo as Monorepo Root
    participant ServerV4 as packages/server-v4 (LEGACY)
    participant Core as @browserbasehq/stagehand
    participant Dist as Dist / Build Outputs
    participant DB as Database (Postgres/PGlite)
    participant BB as Browserbase API

    Note over Repo,BB: NEW: packages/server-v4 deleted entirely

    Note over ServerV4: Previously contained:
    Note over ServerV4: - Fastify app, routes, controllers
    Note over ServerV4: - Drizzle ORM schema, migrations
    Note over ServerV4: - LLM session/service/repository
    Note over ServerV4: - Browser session stubs (in-memory Map)
    Note over ServerV4: - OpenAPI spec, SEA build scripts
    Note over ServerV4: - Unit & integration tests

    loop Before deletion (reference flow)
        ServerV4->>Core: Import stagehand SDK (workspace dependency)
        ServerV4->>DB: Connect (Postgres or PGlite)
        ServerV4->>ServerV4: Run Drizzle migrations on startup
        ServerV4->>ServerV4: Register Fastify plugins (db, llm, swagger)
        Client->>ServerV4: POST /v4/browsersession
        ServerV4->>ServerV4: createBrowserSession() - in-memory stub
        ServerV4-->>Client: Return stub BrowserSession
        Client->>ServerV4: POST /v4/browsersession/:id/end
        ServerV4->>ServerV4: endBrowserSession() - delete from Map
        ServerV4-->>Client: Return ended BrowserSession
        Client->>ServerV4: GET /v4/llms
        ServerV4->>DB: SELECT from llm_configs
        DB-->>ServerV4: llm config rows
        ServerV4-->>Client: LLM list response
        Client->>ServerV4: POST /v4/page/click
        ServerV4->>ServerV4: createPageActionHandler() - stub
        ServerV4-->>Client: Stub action result
    end

    Note over Repo: After deletion:
    Repo->>Repo: No package.json, src/, test/ for server-v4
    Repo->>Repo: No drizzle migrations, no OpenAPI spec
    Repo->>Core: No legacy v4 server depending on stagehand
    Repo->>BB: No v4 routes to Browserbase API

    Note over Dist: Build outputs for server-v4 removed
    Note over DB: No Drizzle migrations for v4 schema
Loading

Note: This PR contains a large number of files. cubic only reviews up to 100 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review.
On a pro plan you can use ultrareview for larger PRs.

Re-trigger cubic

@pirate pirate merged commit 295ac6d into main May 22, 2026
81 of 82 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants