core(cua): implement addContextNote parity for Google/Anthropic/Microsoft clients
Author: BABTUNACreated Apr 24, 2026Updated Sep 24, 2026
Why
V3CuaAgentHandler injects runtime guidance via agentClient.addContextNote(...) for captcha-related flows, but only OpenAICUAClient currently consumes those notes.
As a result, non-OpenAI CUA providers can silently drop important runtime guidance (for example, “captcha already solved; do not click again”), which can cause repeated captcha interaction and less reliable task continuation.
Related merged work:
- #2023
- #1954
Current behavior
addContextNote(...)is called inpackages/core/lib/v3/handlers/v3CuaAgentHandler.ts(captcha solved/errored + click-guard paths)AgentClient.addContextNote(...)defaults to no-opOpenAICUAClientoverrides and injects notes into the next model turnGoogleCUAClient,AnthropicCUAClient, andMicrosoftCUAClientdo not currently consume these notes
Proposed enhancement
Implement parity note handling in non-OpenAI CUA clients:
- Add pending context-note queue behavior in:
GoogleCUAClientAnthropicCUAClientMicrosoftCUAClient
- Inject queued notes into the next model turn in provider-appropriate message/input format
- Clear queued notes after successful injection (same one-shot semantics as OpenAI)
Suggested files
packages/core/lib/v3/handlers/v3CuaAgentHandler.tspackages/core/lib/v3/agent/AgentClient.tspackages/core/lib/v3/agent/OpenAICUAClient.tspackages/core/lib/v3/agent/GoogleCUAClient.tspackages/core/lib/v3/agent/AnthropicCUAClient.tspackages/core/lib/v3/agent/MicrosoftCUAClient.ts
Acceptance criteria
- Context notes injected by
V3CuaAgentHandlerare consumed by Google/Anthropic/Microsoft CUA clients - Notes appear in the next turn only (then are cleared)
- Existing OpenAI behavior remains unchanged
- Unit tests verify note enqueue/drain behavior per client (or shared helper coverage)
Notes
This is primarily a parity/reliability fix; no API surface changes required.
Source: browserbase/stagehand