openwork icon indicating copy to clipboard operation
openwork copied to clipboard

[Bug]: Context snapshot reports empty `affordances` for connected app-bridged MCP connectors

Open thetalmid opened this issue 1 month ago • 2 comments

Summary

openwork_context returns feature entries with empty affordances and guidance for MCP connectors that are connected and whose tools are live in the session (observed for mcp:context7, mcp:firecrawl, mcp:exa; Plane.so tools were also live). An agent reading the snapshot reasonably concludes the connector has no tools, even though the tools are callable. The connector-context preamble ("do not assume it is connected or that its tools are available") compounds the false negative.

To Reproduce

  1. In OpenWork Desktop, connect several MCP connectors (e.g., Context7, Exa, Firecrawl, Plane.so) - all show as configured in Settings > Library.
  2. Start a session and call openwork_context.
  3. Observe the feature entries for mcp:context7, mcp:firecrawl, mcp:exa: each has "affordances": [] and "guidance": [].
  4. Compare with the session's live tool list, which includes the connectors' tools (e.g., context7_web_search_exa, exa_web_search_exa, firecrawl_firecrawl_search, plane-so_workitem).
  5. Call one of those tools - it succeeds.

Expected behavior

The context snapshot reflects live connector state: affordances/guidance (or a dedicated field) lists the injected tools for app-bridged MCPs, and catalog-only features are distinguishable from connected ones.

Actual behavior

Empty arrays for connected connectors. Agents that trust the snapshot - or probe the OpenCode sidecar config files, which only contain locally-registered servers - misdiagnose the connector as disconnected. In the reporter's session, the agent told the user the connector was dead and pursued a token-expiry theory before being corrected.

Screenshots (optional)

No response

OW version & Desktop info (optional)

  • OpenWork version: v0.18.58
  • OS: Windows 11
  • OpenCode sidecar: 1.18.30

Additional context (optional)

  • Evidence from one session (all probes succeeded): Context7 search returned context7.com docs; Exa search returned the exa.ai API reference; Firecrawl search returned firecrawl.dev (creditsUsed: 2); plane-so_workspace retrieve returned the connected workspace's metadata via OAuth (name/slug redacted per the repo's confidentiality rule).
  • Layer mismatch: the OpenCode sidecar layer (runtime-opencode-config.json, project opencode.jsonc, local-managed-mcp-vault.json) contains only locally-registered servers (one stdio GitHub server, one remote Exa entry) - app-bridged MCPs are invisible there, so agents probing config files get a false negative even when the snapshot is also wrong.
  • Suggested fix: populate affordances from the live injected tool set for app-bridged MCPs, or add a liveTools field to the snapshot; revise the preamble when tools are present. (Filed with AI assistance.)

thetalmid avatar Oct 16 '26 03:10 thetalmid

Hey @reachjalil @benjaminshafii, I reproduced this on real engines (v1 and v2, on Linux and Windows). A working connector and a broken one came back identical in openwork_context (affordances: [], guidance: []), even though the working connector's tools were live and callable. On v2, connectors were missing from the snapshot entirely.

Fix is in #6077. Each connector entry now reports its real status. Connected entries also say how to call their tools: toolNamePrefix on v1 (direct tools named <server>_<tool>), toolNamespace on v2 (tools["<server>"] inside execute). Engines don't expose MCP tool names, so these are the reliable handles. I didn't add a feature flag since this only fixes data the agent reads, but I can add one if you'd prefer.

akramcodez avatar Oct 16 '26 06:10 akramcodez

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

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