Dispatch app chat fails on core 0.210: `create_embed_session`'s `startUrl` is redacted and Dispatch only reads it from the result body

オープン 初心者向け
#7,922 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
83/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript

調査の方向性

server/lib/mcp-gateway.js の createEmbedSessionForResolvedApp から始め、create_embed_session の結果をどのように読み取るかを調べます。それを、issue に記載されている core の _meta["agent-native/embedStart"] の形式と比較してください。関連するセッションパスを server/lib/workspace-app-chat-proxy.js で確認してください。app chat proxy が embed session を作成でき、/mode リクエストが 502 を返さなくなれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Versions: @agent-native/core 0.210.2, @agent-native/dispatch 0.40.27 (0.40.28 has the same code). Broken since core 0.210.0, which added the redaction below (0.209.2 does not have it). Multi-app workspace, local dev.

What happens: Open any app inside Dispatch (/dispatch/apps/<app>) and click the app's chat toggle. Nothing opens. Dispatch's chat rail shows "Dispatch could not connect to 's agent, so its chat is unavailable here." This happens for every app. Opening the app directly (/<app>) gives its own chat, which works.

The proxy call behind it fails:

GET /dispatch/_agent-native/workspace-app-chat/<app>/mode → 502
{"error":"<app> chat is unavailable: Could not create an app session for \"<app>\". Workspace sign-in: Dispatch workspace sign-in is not enabled.. Dispatch app grant: Target app did not return an embed start URL.."}

Why: Since 0.210.0, mcp/direct-action-call.js passes every tool result through redactEmbedCredentials (mcp/execute-action-call.js). That drops any value pointing at the embed start route, so create_embed_session's startUrl is removed from both the text content and structuredContent. The URL now travels only in _meta["agent-native/embedStart"] (mcpAppOnlyEmbedStartMeta; the builtin tool has visibility: ["app"]).

Dispatch's createEmbedSessionForResolvedApp (server/lib/mcp-gateway.js) still reads startUrl from parseMcpToolTextResult(result) and never looks at _meta, so it throws "Target app did not return an embed start URL." Both session paths in mintEmbedStartUrl (server/lib/workspace-app-chat-proxy.js) end up there, so turning on dispatch.workspace-sso doesn't help.

Minimal check against core 0.210.2:

import { redactEmbedCredentials } from "@agent-native/core/dist/mcp/execute-action-call.js";
redactEmbedCredentials({
  startUrl: "http://127.0.0.1:8080/_agent-native/embed/start?ticket=tkt_example123",
  targetPath: "/app/home",
  expiresAt: 123,
});
// → { targetPath: "/app/home", expiresAt: 123 }   (startUrl is gone)

Steps:

  1. Workspace with Dispatch and one other app, on core 0.210.x.
  2. Open /dispatch/apps/<app> and click the app's chat toggle.
  3. The chat doesn't open; the workspace-app-chat/<app>/mode request returns 502 as above.

Expected: Dispatch's docked chat opens for the app, as it did on 0.209.x.

Suggested fix: in Dispatch, read the start URL from result._meta["agent-native/embedStart"].startUrl when calling the target's create_embed_session.

主要言語
TypeScript
スター
7.7k
フォーク
706
平均マージ
1日 11時間
マージ済み PR(30日)
790

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

BuilderIO/agent-native のほかの issue

BuilderIO/agent-native の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。