Skip to content

feat(langchain): add Stagehand code-mode integration - #95

Draft
shrey150 wants to merge 3 commits into
shrey/stg-2765-crewai-codemodefrom
shrey/stg-2765-deepagents-codemode
Draft

feat(langchain): add Stagehand code-mode integration#95
shrey150 wants to merge 3 commits into
shrey/stg-2765-crewai-codemodefrom
shrey/stg-2765-deepagents-codemode

Conversation

@shrey150

@shrey150 shrey150 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a LangChain Deep Agents harness that launches the local Stagehand code-mode MCP over stdio
  • hold one explicit MCP session open for the complete agent invocation so browser state survives tool calls
  • load the shared Stagehand V4 syntax guide into the agent system prompt
  • constrain the MCP Python dependency to the compatible 1.x line
  • add a real persistent-session discovery smoke and an isolated Deep Agents CI job

Stack

This PR is stacked on the CrewAI integration. Its diff contains only the LangChain Deep Agents integration.

Lifecycle

The harness opens client.session("stagehand"), loads tools from that session, and runs the complete agent invocation inside the same context. This explicit session is required because the convenience get_tools() path starts a new local MCP process for each tool call, which would discard browser state.

E2E Test Matrix

Command / flow Observed output Confidence / sufficiency
Build the local code-mode package, then run the Deep Agents smoke in an isolated Python 3.12 environment with the reviewed requirements The built server reported that it was listening on stdio and the persistent LangChain session reported Deep Agents persistent stdio discovery PASS: code_execute. Proves the real LangChain MCP adapter can launch the reviewed local stdio server, keep an explicit session open, discover exactly one tool, and receive the shared syntax guide. It does not make a provider-dependent model request.
Resolve the Python requirements from scratch Resolution selected deepagents 0.7.4, langchain-mcp-adapters 0.3.1, and mcp 1.29.0; the isolated smoke then passed. Proves the declared ranges form a compatible fresh environment and avoid the incompatible MCP 2.x API.
Targeted Prettier checks over the Deep Agents documentation and workflow Completed without formatting differences. Covers the changed Markdown and YAML surface; the executed Python smoke imports and runs every changed Python module.

@socket-security

socket-security Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpypi/​mcp@​1.29.099100100100100
Addedpypi/​langchain-mcp-adapters@​0.3.1100100100100100

View full report

@shrey150
shrey150 force-pushed the shrey/stg-2765-deepagents-codemode branch 2 times, most recently from 9c7d683 to 6adf008 Compare August 4, 2026 22:30
@shrey150
shrey150 force-pushed the shrey/stg-2765-deepagents-codemode branch from 6adf008 to 587b115 Compare August 4, 2026 22:34
@shrey150
shrey150 force-pushed the shrey/stg-2765-deepagents-codemode branch from 587b115 to c9e9564 Compare August 4, 2026 22:56
@shrey150
shrey150 force-pushed the shrey/stg-2765-deepagents-codemode branch from c9e9564 to 7c8deb6 Compare August 4, 2026 23:06
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.

1 participant