From 3e6ea0d0d0c3fbecc3f06196feabaf6f672717e6 Mon Sep 17 00:00:00 2001 From: Sergiy Dybskiy Date: Tue, 25 Aug 2026 17:45:12 -0400 Subject: [PATCH] Preview the connections.list item in the connection edit sheet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "What agents see" preview rendered a `- \`\` — ` inventory line. That line left the execute description in #1230, when the inventory was slimmed to bare integration slugs, so the preview showed text no agent reads. The account label was also marked display-only, but `connections.list` returns it to agents next to the description. Render the `connections.list` item (name, identityLabel, description) in the preview, say in the sheet copy that both fields are agent-visible, and note that the callable name stays fixed at connect time. --- .../connection-edit-sheet-agent-preview.md | 9 ++++ packages/core/sdk/src/connection.ts | 8 +-- .../src/components/metadata-edit-sheet.tsx | 50 +++++++++++-------- 3 files changed, 42 insertions(+), 25 deletions(-) create mode 100644 .changeset/connection-edit-sheet-agent-preview.md diff --git a/.changeset/connection-edit-sheet-agent-preview.md b/.changeset/connection-edit-sheet-agent-preview.md new file mode 100644 index 0000000000..5c7ef8d21d --- /dev/null +++ b/.changeset/connection-edit-sheet-agent-preview.md @@ -0,0 +1,9 @@ +--- +"@executor-js/react": patch +--- + +**The connection edit sheet now previews what agents actually read** + +The "What agents see" preview in the connection edit sheet rendered a `- \`\` — `inventory line. That line left the`execute`tool description when the inventory was slimmed to bare integration slugs, so the preview showed text no agent reads. The account label was also marked "Display-only", but`connections.list` returns it to agents alongside the description. + +The preview now mirrors the `connections.list` item for the connection (`name`, `identityLabel`, `description`), and the sheet copy says that both fields are agent-visible while the callable name stays as it was at connect time. diff --git a/packages/core/sdk/src/connection.ts b/packages/core/sdk/src/connection.ts index 9009011774..41fbd8b24c 100644 --- a/packages/core/sdk/src/connection.ts +++ b/packages/core/sdk/src/connection.ts @@ -31,11 +31,11 @@ export interface Connection { /** Callable handle `tools...`. Append `.` * to reach one of its tools. */ readonly address: ConnectionAddress; - /** Optional human label (which account). Not load-bearing. */ + /** Optional human label (which account). Not load-bearing for routing, but + * agent-visible through `connections.list`. */ readonly identityLabel?: string | null; - /** User-curated description of what this connection is for. Agent-visible: - * surfaces next to the connection's prefix in the execute-tool inventory - * and in `connections.list`, so it is the place to give agents context a + /** User-curated description of what this connection is for. Agent-visible + * through `connections.list`, so it is the place to give agents context a * spec can't (e.g. "the staging CRM — reads only"). */ readonly description?: string | null; /** Epoch ms when an OAuth access token expires; null/absent for static creds. */ diff --git a/packages/react/src/components/metadata-edit-sheet.tsx b/packages/react/src/components/metadata-edit-sheet.tsx index ef4ec5074e..9611f07fce 100644 --- a/packages/react/src/components/metadata-edit-sheet.tsx +++ b/packages/react/src/components/metadata-edit-sheet.tsx @@ -25,16 +25,24 @@ import { Textarea } from "./textarea"; // --------------------------------------------------------------------------- // Metadata edit sheets — the user-curated, AGENT-VISIBLE metadata for an // integration and for a connection. The point of the sheet (vs. an inline -// input) is the preview: it shows the exact inventory line an agent reads, so -// editing the description is editing what the model sees. +// input) is the preview: it shows the record an agent reads, so editing a +// field is editing what the model sees. // --------------------------------------------------------------------------- -/** The connection's callable prefix under `tools.`: the path an agent reaches - * this connection's tools through (`tools..`). The execute tool's - * inventory now lists integrations, not per-connection prefixes. */ -const connectionPrefix = (connection: Connection): string => { - const address = String(connection.address); - return address.startsWith("tools.") ? address.slice("tools.".length) : address; +/** The `connections.list` item an agent reads for this connection, reduced to + * the fields the sheet edits. The callable name is fixed at connect time and + * is not editable here; only the label and description are. */ +const connectionListItemPreview = (input: { + readonly name: string; + readonly identityLabel: string; + readonly description: string; +}): string => { + const fields = [ + `name: ${JSON.stringify(input.name)}`, + ...(input.identityLabel ? [`identityLabel: ${JSON.stringify(input.identityLabel)}`] : []), + ...(input.description ? [`description: ${JSON.stringify(input.description)}`] : []), + ]; + return `{ ${fields.join(", ")}, ... }`; }; function AgentPreview(props: { readonly label: string; readonly line: string }) { @@ -88,8 +96,13 @@ export function ConnectionEditSheet(props: { props.onOpenChange(false); }; - const previewDescription = description.trim().split("\n", 1)[0]; - const prefix = connection ? connectionPrefix(connection) : ""; + const previewLine = connection + ? connectionListItemPreview({ + name: String(connection.name), + identityLabel: identityLabel.trim(), + description: description.trim(), + }) + : ""; return ( @@ -97,8 +110,9 @@ export function ConnectionEditSheet(props: { Edit connection - The description is agent-visible: it rides this connection's prefix in the tool - inventory, so it is the place to say what this credential reaches and how to use it. + Both fields are agent-visible: agents read them from connections.list when + they pick an account, so this is the place to say which account this is and what it is + for. @@ -128,18 +142,12 @@ export function ConnectionEditSheet(props: { disabled={saving} />

- Display-only; shown in the accounts list instead of the connection name. + Shown in the accounts list instead of the connection name. Agents see it too, but the + callable name stays as it was at connect time.

- {connection ? ( - - ) : null} + {connection ? : null}