Skip to content

Commit a11d575

Browse files
committed
pnpm updates for stagehand
1 parent cfb81f6 commit a11d575

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,3 +299,4 @@ cython_debug/
299299
#.idea/
300300

301301

302+
.vercel

packages/remote/app/[transport]/route.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { z } from "zod";
33

44
// @ts-ignore
55
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6-
import { defineTool, navigate, common, snapshot, keyboard, getText, session, Context, resolveConfig, PageSnapshot, enableDefaultSessionCreation } from "@mcp/core";
6+
import { defineTool, navigate, common, snapshot, keyboard, getText, session, Context, resolveConfig, PageSnapshot } from "@mcp/core";
77
import { withMcpAuth } from "@/lib/auth";
88
import { loadCtx, saveCtx, type CachedResources, type CachedSnapshot, deleteCtx } from "@/lib/redis";
99

@@ -121,9 +121,7 @@ const mcpServerFactory = (req: Request) => async (server: any) => {
121121
if (tool.schema.name === "browserbase_session_close") {
122122
// Run the tool with the rehydrated context
123123
const result = await callContext.run(tool, params);
124-
125-
// This is the important part: We delete the context from Redis
126-
// to prevent accessing the default session on subsequent calls
124+
127125
try {
128126
await deleteCtx(browserbaseProjectId);
129127
console.log(`Deleted cached context for ${browserbaseProjectId} after session close`);
@@ -133,13 +131,7 @@ const mcpServerFactory = (req: Request) => async (server: any) => {
133131

134132
return result;
135133
}
136-
// At the beginning of each new request, always re-enable session creation
137-
// in case it was disabled by a previous session close operation
138134
else if (tool.schema.name !== "browserbase_session_close") {
139-
// Re-enable default session creation for any tool that isn't session close
140-
enableDefaultSessionCreation();
141-
console.log(`Re-enabled default session creation for tool: ${tool.schema.name}`);
142-
143135
// Special handling for tools that require active snapshots to be reconnected
144136
if (tool.schema.name.startsWith('browserbase_') &&
145137
!['browserbase_session_create', 'browserbase_session_close', 'browserbase_snapshot', 'browserbase_navigate'].includes(tool.schema.name)) {

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)