Skip to content

Fix Pi extension lifecycle in native bridge - #1394

Merged
ymichael merged 4 commits into
get-bb:mainfrom
MPIsaac-Per:agent/fix-pi-extension-lifecycle
Aug 12, 2026
Merged

ymichael merged 4 commits into
get-bb:mainfrom
MPIsaac-Per:agent/fix-pi-extension-lifecycle

Conversation

@MPIsaac-Per

Copy link
Copy Markdown
Contributor

Summary

  • bind configured Pi extensions before the first prompt
  • emit session_shutdown before Pi session disposal
  • cover new and persisted replacement lifecycles with a real extension fixture

Root cause

BB created AgentSession directly through the Pi SDK and skipped bindExtensions(). The MCP adapter registered cached tool metadata, but its session_start handler never initialized runtime state. Every mcp call therefore returned MCP not initialized.

Validation

  • focused Pi bridge and lifecycle tests: 51 passed
  • Turbo typecheck for @bb/agent-runtime: passed
  • Prettier check: passed
  • full @bb/agent-runtime suite: 908 passed; one unrelated timing-sensitive stderr-tail test failed consistently
  • installed pi-mcp-adapter 2.23.0 with a lazy cached configuration returned MCP status in 172 ms without opening a transport

Fixes #1391

AGENT GENERATED: by GPT-5.6 Sol

@ymichael
ymichael merged commit b6aa4d2 into get-bb:main Aug 12, 2026
9 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.

Pi bridge never calls bindExtensions(), so session_start never fires for Pi extensions

2 participants