feat(app): distinct connection states and per-invocation connection origin badges#2760
Open
benjaminshafii wants to merge 2 commits into
Open
feat(app): distinct connection states and per-invocation connection origin badges#2760benjaminshafii wants to merge 2 commits into
benjaminshafii wants to merge 2 commits into
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three UX defects from an enterprise ServiceNow debugging session:
lookup_incidents), easily confused with real ServiceNow tools during debugging.What changed
1. Distinct connection states (desktop Settings → MCP / Connect)
New pure mapper
connectionDisplayState()(apps/app/src/react-app/domains/connections/connection-display-state.ts) with unit-tested signal mapping:enabled === falseor statusdisableddisabledneeds_auth/needs_client_registration/needsAuthauth_requiredconnected(MCP initialize completed)protocol_readyfailed/ failure signalerrorconfiguredmcp-view.tsxandconnect-view.tsxrender these as chips (colors matched to existing tones); i18n via static keys inen.ts. Adegraded(recent tool failures) state was intentionally not added: no per-tool failure signal exists inMcpStatusMap/engine sync today, and this PR does not invent new plumbing — noted for the diagnostics program (#2674) to supply.2. Connection origin on every MCP tool invocation in chat
toolInvocationOrigin()(apps/app/src/lib/tool-invocation-origin.ts) parses dynamic tool names and renders a small badge beside the tool title in the generic tool renderer (components/ui/tool.tsx):<serverName>_<toolName>): badge shows the connection name (longest-prefix match against the session's known MCP servers, with a conservative fallback for unknown prefixes);openwork-cloudexecute_capabilitycalls: parses thenameargument;mcp:<connectionId>:<toolName>renders asOpenWork Cloud → <connection>with the downstream tool as the title (connection name resolved best-effort from client-side data, otherwise the id — no new network calls);dynamic-toolparts: built-in tools (bash, edit, ...) are completely unaffected.3. Unambiguous synthetic tool names
Renamed incident-like mock tools to clearly synthetic names in
packages/enterprise-mcp-mock-server(synthetic_servicenow_lookup,synthetic_servicenow_get_incident,synthetic_servicenow_summarize_incident,synthetic_servicenow_create_incident) and inee/apps/diagnostics(synthetic_servicenow_lookup), with all referencing tests updated.Testing
apps/app:bun test --isolate tests/connection-display-state.test.ts tests/tool-invocation-origin.test.ts— 13 pass (every state mapping; direct MCP, OpenWork Cloud arg parsing, built-in passthrough, malformed args).pnpm --filter @openwork/app typecheck— clean.pnpm --filter @openwork/enterprise-mcp-mock-server test— 162 pass, 0 fail.pnpm --filter @openwork-ee/diagnostics test— 28 pass, 0 fail.pnpm --filter @openwork-ee/den-api exec bun test test/external-capabilities-search-divergence.test.ts— 17 pass, 0 fail (rename touch-point).No video/fraimz attached yet — stated explicitly per repo policy; the UI changes are covered by pure-function unit tests + typecheck, and a fraimz proof can follow up on request. Reviewer repro: (1) open Settings → MCP with a mix of enabled/disabled/needs-auth servers and observe distinct chips ("Ready", "Needs sign-in", "Off", "Set up, not started", "Error"); (2) run any MCP tool in chat and observe the connection badge beside the tool row; run an OpenWork Cloud capability and observe
OpenWork Cloud → <connection>.