Skip to content

[GRO-237] change user metadata in session create to strings #103

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

Merged
merged 1 commit into from
Jul 30, 2025

Conversation

Kylejeong2
Copy link
Collaborator

what

change user metadata in session create to strings, bug fix

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR addresses a bug in the Browserbase session creation process by converting a boolean metadata value to a string. Specifically, the change modifies the userMetadata field in src/stagehandStore.ts where the mcp property is changed from the boolean true to the string "true".

This change is necessary because Browserbase's session metadata API has specific limitations - it only supports string values for querying and comparison operations. According to Browserbase's documentation, the API "only supports querying by fields (no arrays) and checking value equality of strings (no numbers or booleans)." The recommended approach is to "convert numbers and booleans into strings and query normally."

The MCP server likely needs to query sessions by the mcp metadata field to identify which sessions were created by the MCP server versus other sources. This metadata filtering capability is essential for proper session management within the broader Browserbase ecosystem. By ensuring the metadata value is a string, the server can successfully filter and identify MCP-created sessions through Browserbase's API.

Confidence score: 5/5

  • This is a straightforward bug fix that addresses a clear API compatibility issue with minimal risk.
  • The change is well-documented in the context and aligns with Browserbase's documented API requirements for metadata querying.
  • No files need additional attention - the change is isolated and addresses the root cause directly.

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

@derekmeegan derekmeegan merged commit 1b3fb63 into main Jul 30, 2025
1 check 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