You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] MCP tool results drop structuredContent — the official computer-use plugin can't reach its own element_token
#7788
The new experimental computer-use provider (@deepseek-ai/dsh-experimental-computer-use-cua-driver-native) ships a system prompt section that tells the model:
Use element_token from that snapshot, or coordinates from its screenshot. A new snapshot of that window invalidates its earlier element tokens.
I spent a while trying to follow that instruction and couldn't — the token never arrives. After pulling the chain apart, I think the tool-result bridge is throwing away exactly the half of the result the tool wants the model to use.
Here's what I found.
The provider calls the native driver and hands the raw MCP result to createMcpToolDefinition from @deepseek-ai/dsh-mcp-client:
So anything an upstream tool puts in structuredContent stays invisible to the model.
That matters here, because cua-driver puts everything useful in there. I asked the native runtime directly (listToolsJson) — out of 56 tools, 34 declare an outputSchema, and get_window_state is the only one whose schema mentions tokens:
elements[].element_token
snapshot_id
elements[].frame — {x, y, w, h}
Then I called it and read the raw JSON. content carries the markdown tree and the screenshot. structuredContent carries elements with 239 entries, and 239 of 239 have both element_token and frame. None of it reaches the model — in my session log the string structuredContent appears exactly zero times.
Two things this actually cost me:
The guidance says to use element_token, so the only route left is pixel coordinates. For an Electron window under 175% display scaling, I couldn't get a synthetic click to land at all — three attempts, no error, nothing happened. Pressing the very same button through UIA InvokePattern (from a plugin of mine, gui_uia) works on the first try, so the accessibility route itself is fine. It's just unreachable from the official provider.
frame is the authoritative screen rectangle. Dropping it forces coordinate math across DPI scaling and multi-monitor layouts — which is where my mis-clicks came from.
I genuinely don't know whether render() ignoring structuredContent is deliberate, maybe it's meant to be UI-only. If so, the computer-use provider has no way to opt in, and its prompt ends up asking for something the runtime can't deliver.
Would something along these lines be reasonable: when a tool declares an outputSchema, either serialize structuredContent into the model-visible text, or let a tool mark which structured fields the model should see?
Happy to test a patch if someone points me at the intended direction. Reproducible on Windows 11 with DSH 0.1.7-rc.2, and I still have the raw outputs if they'd help.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
The new experimental computer-use provider (
@deepseek-ai/dsh-experimental-computer-use-cua-driver-native) ships a system prompt section that tells the model:I spent a while trying to follow that instruction and couldn't — the token never arrives. After pulling the chain apart, I think the tool-result bridge is throwing away exactly the half of the result the tool wants the model to use.
Here's what I found.
The provider calls the native driver and hands the raw MCP result to
createMcpToolDefinitionfrom@deepseek-ai/dsh-mcp-client:dsh-mcp-clientkeeps both halves increateExecutor:but the renderer only projects
content:So anything an upstream tool puts in
structuredContentstays invisible to the model.That matters here, because cua-driver puts everything useful in there. I asked the native runtime directly (
listToolsJson) — out of 56 tools, 34 declare an outputSchema, andget_window_stateis the only one whose schema mentions tokens:elements[].element_tokensnapshot_idelements[].frame—{x, y, w, h}Then I called it and read the raw JSON.
contentcarries the markdown tree and the screenshot.structuredContentcarrieselementswith 239 entries, and 239 of 239 have bothelement_tokenandframe. None of it reaches the model — in my session log the stringstructuredContentappears exactly zero times.Two things this actually cost me:
The guidance says to use
element_token, so the only route left is pixel coordinates. For an Electron window under 175% display scaling, I couldn't get a synthetic click to land at all — three attempts, no error, nothing happened. Pressing the very same button through UIAInvokePattern(from a plugin of mine,gui_uia) works on the first try, so the accessibility route itself is fine. It's just unreachable from the official provider.frameis the authoritative screen rectangle. Dropping it forces coordinate math across DPI scaling and multi-monitor layouts — which is where my mis-clicks came from.I genuinely don't know whether
render()ignoringstructuredContentis deliberate, maybe it's meant to be UI-only. If so, the computer-use provider has no way to opt in, and its prompt ends up asking for something the runtime can't deliver.Would something along these lines be reasonable: when a tool declares an
outputSchema, either serializestructuredContentinto the model-visible text, or let a tool mark which structured fields the model should see?Happy to test a patch if someone points me at the intended direction. Reproducible on Windows 11 with DSH 0.1.7-rc.2, and I still have the raw outputs if they'd help.
All reactions