This PR contains the following updates:
| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
|
[@anthropic-ai/claude-agent-sdk](https://redirect.github.com/anthropics/claude-agent-sdk-typescript)
| devDependencies | patch | [`^0.3.216` →
`^0.3.218`](https://renovatebot.com/diffs/npm/@anthropic-ai%2fclaude-agent-sdk/0.3.217/0.3.218)
| `0.3.220` (+1) |
---
### Release Notes
<details>
<summary>anthropics/claude-agent-sdk-typescript
(@​anthropic-ai/claude-agent-sdk)</summary>
###
[`v0.3.218`](https://redirect.github.com/anthropics/claude-agent-sdk-typescript/blob/HEAD/CHANGELOG.md#03218)
[Compare
Source](https://redirect.github.com/anthropics/claude-agent-sdk-typescript/compare/v0.3.217...v0.3.218)
- `SkillToolOutput` now reports `background: true` when a forked skill
was dispatched as a detached background agent
- Fixed the result event's `api_error_status` reporting null for
rate-limit and overloaded errors delivered mid-stream; it now reports
429/529
- Added `canonicalModel` and `provider` to each `modelUsage` entry in
result messages so downstream billing can look up the correct rate table
for `costUSD`
</details>
---
### Configuration
📅 **Schedule**: (UTC)
- Branch creation
- "before 6am every weekday"
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend
Renovate](https://redirect.github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yODEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjI4MS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0aW9uIl19-->
## Description
`createACPTool()` and `AcpAgent` hardcoded the ACP client inside
`ACPConnection`, so there was no way to answer agent-initiated extension
methods (`extMethod` / `extNotification`). Agents that use them (e.g.
Grok CLI) fail — the default client rejects any custom method with
JSON-RPC `-32601 "Method not found"` and the agent aborts its turn — and
the only workaround was forking ~300 lines of connection/spawn/stream
plumbing just to swap one class. This PR exposes the injection point the
underlying `@agentclientprotocol/sdk` already has.
- Add `createClient?: (defaultClient: Client) => Client` to
`CreateACPToolOptions` (inherited by `AcpAgentOptions`); the callback
receives the default client so it can be wrapped/extended or fully
replaced, and the returned client is passed to `ClientSideConnection`
- Re-export the SDK `Client` type from `@mastra/acp` for fully custom
implementations
- Handle child-process spawn failures: previously a bad `command`
(ENOENT) emitted an unhandled `'error'` event and crashed the host
process; initialization is now raced against process `error`/`exit` so
the tool call rejects with the spawn error (stderr attached) instead
- Extract the init sequence into `initializeSession()` so it can be
raced; default-path behavior is unchanged
- Tests: mock child process is now an `EventEmitter`; 4 new tests cover
custom client wiring (ext methods handled, default handlers preserved),
omitted option, spawn ENOENT rejection, and early process exit
- Docs: `createClient` parameter on both reference pages plus a new
"Extension methods" section with a usage example
Verified end-to-end: a protocol-exact fake agent calling `_grok/ping`
fails on main and succeeds with `createClient`; a real ACP agent
(`@zed-industries/claude-code-acp`, live Anthropic API) works on both
the default and wrapped-client paths; full customer-shaped run (real
model → Mastra agent loop → tool-call → ACP process → ext method
answered → output returned) passes.
## Related Issue(s)
Fixes#19109
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [x] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [x] I have made corresponding changes to the documentation (if
applicable)
- [x] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have addressed all Coderabbit comments on this PR
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This update lets you plug in your own “ACP client” so the SDK can handle
agent requests your way (including custom extension actions), without
you having to copy the SDK’s complex connection code. It also prevents
agent startup failures from crashing your app by turning
spawn/early-exit problems into normal rejected tool calls.
## What changed
- Added an optional `createClient` hook to `createACPTool()` /
`CreateACPToolOptions`, and it’s inherited by `AcpAgentOptions`.
- The factory receives the SDK’s default ACP `Client` and can
wrap/extend/replace it (enabling custom extension handlers like
`extMethod` and `extNotification`).
- Re-exported the ACP `Client` type from `@mastra/acp` to support fully
custom client implementations.
- Fixed child-process failure handling during initialization:
- Initialization failures now reject tool calls with
spawn/initialization errors instead of causing unhandled host-process
crashes.
- Agent startup failure detection was implemented using
`initializeSession()` and failure/early-exit handling; cleanup is added
when the client factory throws.
- Added tests for:
- custom client wiring + extension availability
- omitted options (default behavior)
- client-factory errors (including cleanup)
- spawn failures (`error` event)
- early process exits (`exit` during initialization)
- Updated documentation for `createClient` and added an “Extension
methods” section with an example.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [@cursor/sdk](https://cursor.com)
([source](https://redirect.github.com/cursor/cursor)) | devDependencies
| patch | [`^1.0.17` ->
`^1.0.18`](https://renovatebot.com/diffs/npm/@cursor%2fsdk/1.0.17/1.0.18)
|
---
### Release Notes
<details>
<summary>cursor/cursor (@​cursor/sdk)</summary>
###
[`v1.0.18`](0d42fa8dcf...0897dcaa25)
[Compare
Source](0d42fa8dcf...0897dcaa25)
</details>
---
### Configuration
📅 **Schedule**: Branch creation - "before 6am every weekday" (UTC),
Automerge - At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNzMuMSIsInVwZGF0ZWRJblZlciI6IjQxLjE3My4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0aW9uIl19-->
## Description
Two fixes to the browser state signal:
1. **Suppress "Browser is closed" when the agent never used the
browser** — if there's no previous state signal (browser was never
reported as open) and the browser is currently closed, the signal is
suppressed entirely. This prevents confusing messages when an agent has
a browser configured but the user/agent hasn't actually used it.
2. **Add `closeReason` to differentiate why the browser closed** — new
optional field on `BrowserContext` with values `'agent' | 'user' |
'process_restart' | 'error'`. The formatted state signal message changes
based on the reason:
- `process_restart` → "The session process restarted, which closed the
browser."
- `user` → "The user closed the browser."
- `error` → "Browser closed unexpectedly due to an error."
- `agent`/default → "Browser is closed."
The `closeReason: 'error'` is now set in `agent.ts` when
`getBrowserState()` throws. Other reasons (`process_restart`, `user`)
can be set by callers that have that context (e.g. the session runtime
or viewer registry).
## Related issue(s)
Fixes the issue discussed in Slack where the state signal showed
"Browser is closed" even when the agent hadn't used the browser at all.
## Type of change
- [x] Bug fix (non-breaking change that fixes an issue)
- [x] New feature (non-breaking change that adds functionality)
## Checklist
- [x] I have linked the related issue(s) in the description above
- [x] I have made corresponding changes to the documentation (if
applicable)
- [x] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have addressed all Coderabbit comments on this PR
Link to Devin session:
https://app.devin.ai/sessions/34fece46417c4d0cb01a1a73e3871126
Requested by: @TylerBarnes
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
The PR prevents a misleading "Browser is closed" message when the agent
never opened the browser and attaches a short reason for why a browser
closed (agent, user, process restart, or error) so state messages are
accurate and useful.
## Changes Summary
### Core Changes
- Suppress spurious closed signals
- computeStateSignal() no longer emits a plain "Browser is closed" state
when the thread has never previously reported the browser open; closed
signals are only emitted when there is a meaningful prior open-state in
the thread history.
- Adds logic to avoid emitting ambiguous "bare closed" deltas.
- Close reason tracking and messaging
- BrowserContext / persisted BrowserState gains optional closeReason?:
'agent' | 'user' | 'process_restart' | 'error'.
- computeStateSignal preserves or infers closeReason and uses it to
format messages:
- process_restart → "The session process restarted, which closed the
browser."
- user → "The user closed the browser."
- error → "Browser closed unexpectedly due to an error."
- agent/default → "Browser is closed."
- Delta formatting for open: false uses the closeReason text instead of
a generic closed message.
- Agent error-handling
- packages/core/src/agent/agent.ts: when getBrowserState() throws, the
resolver returns { isOpen: false, closeReason: 'error' } so exceptions
are attributed to 'error'.
### Browser / Agent-Browser Changes
- AgentBrowser
- Tracks per-thread (and default) close reasons and agent-driven
active-URL changes.
- Persists thread-aware closed state including tracked closeReason and
activeUrlChangeSource.
- Clears tracking maps on launch; closeThreadSession override saves
thread-specific last state.
- getBrowserState(threadId) routes through thread-aware logic to include
closeReason/activeUrlChangeSource.
- Close tool
- createCloseTool records agent-initiated closeReason ('agent')
(thread-aware) before closing.
- Navigation tools
- goto/back/new/switch record agent-driven URL changes so
activeUrlChangeSource can be attributed correctly.
### Persistence & Thread Manager
- Thread-manager persistence schema updated to include optional
closeReason and activeUrlChangeSource.
- updateBrowserState now shallow-copies incoming state and preserves
extra fields (so closeReason/activeUrlChangeSource are not dropped).
### Mastracode / UI Streaming Fix
- Anchors streamed state_signal components before the active assistant
text component so later assistant text updates do not push the signal
down the chat stream.
- Adds a TUI regression test ensuring the state signal is inserted and
the streamed assistant text renders correctly.
### Tests & Docs
- Extensive tests added/updated:
- computeStateSignal tests expanded to cover suppression when browser
was never opened, open-from-remembered-closed with active URL
propagation, close reason attribution (process_restart, user, error),
activeUrlChangeSource attribution (agent vs user), and suppression when
only source metadata toggles.
- agent-browser tests verify preservation and correct inheritance of
closeReason and activeUrlChangeSource behavior.
- mastracode TUI tests added to verify anchored state signal behavior.
- Changesets updated to document patch releases for `@mastra/core`,
`@mastra/agent-browser`, and `mastracode`.
- Minor CI/test/ESLint adjustments included.
### API / Interface Changes
- Interface updates:
- BrowserContext / BrowserState: added closeReason?: 'agent' | 'user' |
'process_restart' | 'error'
- BrowserState: added activeUrlChangeSource?: 'agent' | 'user'
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: tyler <tylerdbarnes@gmail.com>
Co-authored-by: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.
⚠️⚠️⚠️⚠️⚠️⚠️
`main` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `main`.
⚠️⚠️⚠️⚠️⚠️⚠️
# Releases
> The changelog information of each package has been omitted from this
message, as the content exceeds the size limit.
## @mastra/openai@0.1.0-alpha.1
## @mastra/client-js@1.24.0-alpha.0
## @mastra/core@1.42.0-alpha.0
## @mastra/playground-ui@33.0.0-alpha.0
## @mastra/server@1.42.0-alpha.0
## @mastra/pg@1.13.0-alpha.0
## @mastra/claude@0.1.1-alpha.0
## @mastra/react@0.5.3-alpha.0
## @mastra/deployer-cloud@1.42.0-alpha.0
## @mastra/deployer-cloudflare@1.1.43-alpha.0
## @mastra/deployer-netlify@1.1.19-alpha.0
## @mastra/deployer-vercel@1.1.37-alpha.0
## @mastra/longmemeval@1.0.49-alpha.0
## @mastra/opencode@0.0.46-alpha.0
## mastracode@0.22.3-alpha.0
## @mastra/arize@1.2.2-alpha.0
## @mastra/arthur@0.3.2-alpha.0
## @mastra/laminar@1.2.2-alpha.0
## @mastra/langfuse@1.3.5-alpha.0
## @mastra/otel-bridge@1.2.2-alpha.0
## @mastra/otel-exporter@1.2.2-alpha.0
## @mastra/posthog@1.0.28-alpha.0
## @mastra/sentry@1.1.3-alpha.0
## mastra@1.12.3-alpha.0
## @mastra/deployer@1.42.0-alpha.0
## @mastra/editor@0.11.2-alpha.0
## @mastra/mcp@1.9.2-alpha.0
## @mastra/mcp-docs-server@1.1.46-alpha.0
## @mastra/express@1.3.30-alpha.0
## @mastra/fastify@1.3.30-alpha.0
## @mastra/hono@1.4.25-alpha.0
## @mastra/koa@1.5.13-alpha.0
## @mastra/nestjs@0.1.14-alpha.0
## @mastra/dsql@1.0.2-alpha.0
## @mastra/dynamodb@1.0.8-alpha.0
## @mastra/s3vectors@1.0.6-alpha.0
## @mastra/spanner@1.1.1-alpha.0
## @mastra/voice-aws-nova-sonic@0.1.3-alpha.0
## @mastra/voice-google@0.12.2-alpha.0
## @mastra/voice-google-gemini-live@0.12.1-alpha.0
## @mastra/temporal@0.1.13-alpha.0
## @mastra/agentcore@0.2.1-alpha.0
## @mastra/blaxel@0.4.1-alpha.0
## @mastra/e2b@0.3.3-alpha.0
## @mastra/gcs@0.2.2-alpha.0
## @mastra/s3@0.5.2-alpha.0
## create-mastra@1.12.3-alpha.0
## @internal/playground@1.12.3-alpha.0
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>