From 4734e206a9187752df68720976d5263cc597b4bd Mon Sep 17 00:00:00 2001 From: Debug Agent Date: Wed, 20 May 2026 11:10:15 +0200 Subject: [PATCH] perf(adapter): opt into ?include_skills=false on batch conversation fetch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Canvas only reads ``agent.kind`` and ``agent.llm.model`` from ``GET /api/conversations`` responses (see ``toAppConversation``) — the ~260 KB ``agent.agent_context.skills`` payload that ``load_user_skills=true`` / ``load_public_skills=true`` agents accumulate is never accessed client-side, but every conversation poll has to parse + structurally-share it, which is the bottleneck the perf profiling identified. Pass ``{ includeSkills: false }`` to ``ConversationClient.getConversations`` so the agent-server trims the payload at the route boundary. The local agent-server runtime keeps the full skill catalog server-side for prompt rendering — pure client-side perf with no functional change. Companion PRs (both pinned via SHA temporarily so this PR is end-to-end runnable / lintable / profileable; SHAs flip to released versions once both companions ship): - software-agent-sdk#3316: server-side ``include_skills`` query param - typescript-client#172: typed ``includeSkills`` option on ``ConversationClient``, pinned via the SHA in package.json Measured impact (full empirical profile in software-agent-sdk#3301): ~260 KB → ~5 KB on the wire, ``first event painted`` 2226 ms → 1283 ms (-42%) for a 40-skill conversation cold-open. Co-Authored-By: Claude Opus 4.7 (1M context) --- package-lock.json | 4 ++-- package.json | 2 +- .../agent-server-conversation-service.api.ts | 13 ++++++++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 744f57f12..350121d69 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@heroui/react": "2.8.10", "@microlink/react-json-view": "1.31.20", "@monaco-editor/react": "4.7.0", - "@openhands/typescript-client": "git+https://github.com/OpenHands/typescript-client.git#v0.6.0", + "@openhands/typescript-client": "git+https://github.com/OpenHands/typescript-client.git#6aa5593b0a0fba0be25881706c84feebd9802a40", "@react-router/node": "7.14.2", "@react-router/serve": "7.14.2", "@tailwindcss/vite": "4.2.4", @@ -3440,7 +3440,7 @@ }, "node_modules/@openhands/typescript-client": { "version": "0.1.1", - "resolved": "git+https://github.com/OpenHands/typescript-client.git#ef62e82fc3dfb03991a1c8025429caf354427263", + "resolved": "git+https://github.com/OpenHands/typescript-client.git#6aa5593b0a0fba0be25881706c84feebd9802a40", "license": "MIT", "dependencies": { "@openrouter/sdk": "^0.12.35", diff --git a/package.json b/package.json index 89774e43a..98a3418c9 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "@heroui/react": "2.8.10", "@microlink/react-json-view": "1.31.20", "@monaco-editor/react": "4.7.0", - "@openhands/typescript-client": "git+https://github.com/OpenHands/typescript-client.git#v0.6.0", + "@openhands/typescript-client": "git+https://github.com/OpenHands/typescript-client.git#6aa5593b0a0fba0be25881706c84feebd9802a40", "@react-router/node": "7.14.2", "@react-router/serve": "7.14.2", "@tailwindcss/vite": "4.2.4", diff --git a/src/api/conversation-service/agent-server-conversation-service.api.ts b/src/api/conversation-service/agent-server-conversation-service.api.ts index 0a20b18cb..e541465f8 100644 --- a/src/api/conversation-service/agent-server-conversation-service.api.ts +++ b/src/api/conversation-service/agent-server-conversation-service.api.ts @@ -411,9 +411,20 @@ class AgentServerConversationService { return batchGetCloudConversations(ids); } + // Opt into ``include_skills=false`` so the agent-server trims the + // ~260 KB ``agent.agent_context.skills`` payload from each + // conversation. Canvas only reads ``agent.kind`` and + // ``agent.llm.model`` from these responses (see ``toAppConversation`` + // — the skills list is never accessed), and the local agent-server + // runtime keeps the full skill catalog server-side for prompt + // rendering. Companion PRs: + // - software-agent-sdk#3316 (server-side query param) + // - typescript-client#172 (typed ``includeSkills`` option) const data = await new ConversationClient( getAgentServerClientOptions(), - ).getConversations(ids); + ).getConversations(ids, { + includeSkills: false, + }); return requireDirectConversationItems(data).map((item) => toAppConversation(item),