Summary
Hard CDP fallback (/^cdp[A-Z]/ → executeCDPToolDirect) in the bridge and the content-script Unknown-tool forwarder are production safety nets for insert_text. They are easy to regress without automated coverage.
Repro
- Context: Unpacked extension with current bridge + messaging patches; MCP calling CDP verbs by wire name.
- Steps:
- Force resolve to return null (or simulate missing
getToolByNameOrVerb).
- Dispatch tool name
cdpInsertText (or MCP insert_text that wires that verb).
- Confirm path hits
executeCDPToolDirect / method: cdp_direct rather than Unknown tool.
- Observed without fallback: hard fail. With fallback (local branch): success.
Code pointers (verified against /workspace/FSB)
extension/ws/mcp-bridge-client.js — /^cdp[A-Z]/ fallback (~L1908–1924).
extension/content/messaging.js — last-resort CDP forward (~L1062–1088).
extension/background.js — executeCDPToolDirect (~L19786+), cdpInsertText (~L20055+).
tests/ — add focused unit tests under existing patterns (no dedicated CDP-fallback test found yet; likely area: new test beside bridge/dispatcher tests).
Proposed fix
Add regression tests that (1) bridge routes unresolved cdpInsertText to executeCDPToolDirect, and (2) content messaging forwards /^cdp/ instead of returning Unknown tool. Keep the fallbacks; do not remove them as “dead code.”
Acceptance / regression
- CI fails if either fallback is deleted or gated behind a broken resolve-only path.
- Manual:
insert_text on x.com compose reports success via CDP path after SW stress.
Owner
extension
Priority: P1 · Owner: extension
Summary
Hard CDP fallback (
/^cdp[A-Z]/→executeCDPToolDirect) in the bridge and the content-script Unknown-tool forwarder are production safety nets forinsert_text. They are easy to regress without automated coverage.Repro
getToolByNameOrVerb).cdpInsertText(or MCPinsert_textthat wires that verb).executeCDPToolDirect/method: cdp_directrather thanUnknown tool.Code pointers (verified against /workspace/FSB)
extension/ws/mcp-bridge-client.js—/^cdp[A-Z]/fallback (~L1908–1924).extension/content/messaging.js— last-resort CDP forward (~L1062–1088).extension/background.js—executeCDPToolDirect(~L19786+),cdpInsertText(~L20055+).tests/— add focused unit tests under existing patterns (no dedicated CDP-fallback test found yet; likely area: new test beside bridge/dispatcher tests).Proposed fix
Add regression tests that (1) bridge routes unresolved
cdpInsertTexttoexecuteCDPToolDirect, and (2) content messaging forwards/^cdp/instead of returning Unknown tool. Keep the fallbacks; do not remove them as “dead code.”Acceptance / regression
insert_texton x.com compose reports success via CDP path after SW stress.Owner
extension
Priority: P1 · Owner: extension