openwork icon indicating copy to clipboard operation
openwork copied to clipboard

[Bug]: websearch fails with Web search cancelled without a user cancel

Open pcharasz opened this issue 1 month ago • 4 comments

Summary

The built-in websearch tool fails immediately with Web search cancelled even when the user did not cancel the action. OpenWork shows that as "This action couldn't finish." Direct page fetches (webfetch) still work. No web-search provider is configured, and the provider-selection prompt that OpenCode 2 is supposed to show is not rendered by OpenWork, so the search is aborted and misreported as a user cancel.

To Reproduce

  1. Open OpenWork Desktop 0.18.63 on Windows, on the OpenCode v2 engine (opencode2.exe 2.0.26), with no websearch.provider in config and no search-provider API key set (EXA_API_KEY, FIRECRAWL_API_KEY, PARALLEL_API_KEY, TAVILY_API_KEY, TINYFISH_API_KEY all unset).
  2. In a chat, ask the agent to search the web (for example: "search the web for speed limits on roads in Germany").
  3. Do not click Cancel, Stop, or dismiss any prompt.
  4. See the websearch tool card.

Expected behavior

The first search should ask the user to allow web search and choose a provider (Exa, Firecrawl, Parallel, Tavily, or TinyFish), as documented for OpenCode v2. If no provider can be selected, the error should say that a provider is required, not that the search was cancelled.

Actual behavior

Every websearch call returns immediately, including a single call with no other tools running:

{"error":{"type":"unknown","message":"Web search cancelled"},"content":[]}

OpenWork displays:

This action couldn't finish
This action couldn't finish. Check the details before trying again.
websearch
Web search cancelled

The user did not cancel anything. webfetch of a normal HTTPS URL succeeds in the same session, so this is not a general network failure. A browser-origin restriction would also deny webfetch, so that is not the cause.

Reproduced consistently (three calls in one session).

Screenshots (optional)

Not attached. The tool card shows the query and the text Web search cancelled.

OW version & Desktop info (optional)

  • OpenWork version: 0.18.63 (FileVersion of OpenWork.exe; matches release v0.18.63)
  • OS: Microsoft Windows 10.0.26300, win32 x64
  • Shell: cmd.exe
  • Terminal: OpenWork desktop, not a terminal app
  • Engine: OpenCode v2 sidecar opencode2.exe 2.0.26. The v1 sidecar opencode.exe 1.18.33 is also installed, but this session was on v2.
  • Install/channel: release
  • Active plugins: OpenWork-managed plugins context-plugin, mcp-readiness-plugin, mcp-results-plugin, provider-filters-plugin, provider-sync-plugin, visible-reasoning-plugin, and gateway-quota-plugin. No project-local plugins.

Additional context (optional)

  • OpenCode v2 docs say the first search asks the user to allow web search and select a provider: https://opencode.ai/v2/docs/websearch/
  • The running v2 config has no websearch key. Setting "websearch": { "provider": "..." } is the documented way to skip the picker.
  • opencode2.exe contains the user-facing strings Web search cancelled, Choose a web search provider, Choose a provider for web search., and Allow OpenCode to search the web for up-to-date information?, plus distinct errors Web search provider is required (websearch_provider_required), Web search provider not found, Web search is disabled, and The user declined this tool call.
  • Those picker strings are not in the OpenWork app bundle. OpenWork's permission UI only has a "Search the web" toggle. It does not appear to render the provider-selection form, so the engine aborts the interaction and reports a cancel.
  • No matching open issue was found for Web search cancelled or websearch in the title.
  • Workaround not verified: connect a provider and set websearch.provider so the picker is never opened.
  • Filed with AI assistance.

pcharasz avatar Oct 30 '26 17:10 pcharasz

Yes, same issue here.

Summary

Web search in OpenWork Desktop is consistently cancelled and returns no results. This has reportedly happened for about a week and continues after restarting the app.

Environment

  • OpenWork Desktop version: 0.18.64-alpha.3872
  • Bundled OpenCode version: 1.18.33
  • OS: macOS 27.0, Apple Silicon
  • Workspace: OpenWork Desktop starter workspace
  • Shell: /bin/zsh
  • Terminal: OpenWork Desktop; terminal variables are incomplete
  • Active plugins: OpenWork-managed plugins and opencode-scheduler

Reproduction

  1. In OpenWork Desktop, ask it to search the web, for example: “children in Soviet-style uniforms at the White House yesterday.”
  2. The search action returns “Web search cancelled” / “This action couldn’t finish.”
  3. Retry with different phrasings; the same cancellation occurs.
  4. Restart OpenWork and try again; it still cancels.

Expected Behavior

The web search should return results, or show a useful error explaining why the search provider is unavailable.

Actual Behavior

The built-in web search cancels consistently without returning results. It also failed when tested from this conversation after an app restart.

Additional Context

  • The issue has reportedly been occurring for about a week.
  • Restarting OpenWork did not fix it.
  • Public Bing News search works from the same environment and finds a relevant article, suggesting general internet access is available.
  • The local OpenCode log shows repeated timeouts fetching models.dev and intermittent OpenWork Cloud MCP SSE disconnects (ECONNRESET). These may be unrelated; logs did not expose a specific web-search failure.
  • No credentials or private search query history are included here.

denismakarovmodel-star avatar Oct 30 '26 18:10 denismakarovmodel-star

I'd like to work on this! @benjaminshafii @OmarMcAdam please assign me.

user-Param avatar Oct 31 '26 10:10 user-Param

I'd like to work on this issue. I've reviewed the problem statement and I can see that OpenWork doesn't render the OpenCode v2 provider-selection prompt for websearch. I'm ready to investigate and fix this — please assign me.

@benjaminshafii @OmarMcAdam — could you please assign me to this issue? Thank you!

user-Param avatar Oct 31 '26 10:10 user-Param

I traced the cause on macOS (Apple silicon), OpenWork 0.18.63 with its bundled OpenCode v2 sidecar.

Root cause: the app drops the engine's provider prompt.

When no web search provider is selected, the v2 websearch tool asks the user through a form (form.created) whose metadata is { kind: "websearch.provider" }. Its field choice offers "Allow search via ...", "Choose another provider" and "Disable web search"; choosing another provider opens a second form with a provider field.

mapV2Question in apps/app/src/app/lib/opencode-v2-adapter.ts (line 219 on dev as of 2026-11-02) returns null unless the form's metadata.kind is exactly "question":

if (!isRecord(value) || readString(value.metadata, "kind") !== "question") return null;

So the websearch.provider form never becomes a question request, and nothing is rendered.

Why it reports "Web search cancelled".

The engine waits for that form with a one-minute timeout, and the timeout's fallback is Error("Web search cancelled"). That same message is also used when the form is cancelled. In my case the websearch tool part ran for exactly 60.0 seconds (time.ran to time.completed) before failing with that error. No selection is saved under the engine's websearch:provider key, so every search repeats the hidden prompt and the timeout.

Possible fix.

Accept websearch.provider forms in mapV2Question; its field types (string, fixed options, custom: false) already fit the existing mapping. Alternatively, map any form whose fields are all string or multiselect and keep kind only for labelling. Replies would go back through the same form reply path as other questions.

Separately, the engine could report that a provider is required, or that the prompt timed out, instead of reusing "cancelled" for both, but that message lives in OpenCode rather than OpenWork.

Workaround.

Set "websearch": { "provider": "..." } in the v2 engine config, as the issue describes, so the prompt is skipped.

jshahbazi avatar Nov 03 '26 00:11 jshahbazi