github / github/app

[Requests and ideas] Title: Let canvas extensions invoke host/app capabilities (e.

未关闭
#1,284 0 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
Requests and ideas
主要语言
没有语言数据
星标
2.1k
派生
153
PR 合并指标
30 天内没有已合并 PR

描述

**Mood:** 😔
**Category:** Requests and ideas

Title: Let canvas extensions invoke host/app capabilities (e.g. create_session) without round-tripping through an agent turn

What I'm building
I built a user-scoped canvas extension ("Quest Board") that turns my Daily Brief into gamified XP quests. Each quest card has a Start session button: it should open a new Copilot session seeded with that quest's full context so I can start working on it immediately.

The gap
A canvas extension runs as a forked Node process speaking the extension JSON-RPC protocol. It has no way to create a session. Session creation (create_session, plus the related orchestration tools like list_projects, open_pr_session, send_session_message) is an app/agent capability — it's exposed to the agent as a tool, but it is not on the extension SDK surface. I checked session.rpc: the available namespaces are send, abort, suspend, shutdown, auth, canvas, model, mode, plan, fleet, agent/tasks, schedule, etc. — none create an app project-session. The only createSession in the SDK lives on CopilotClient (the host that owns the runtime), which an extension can't reach.

The workaround (and why it's awkward)
The only lever an extension has is session.send(), which injects a user turn into the current session; the agent in that turn then calls create_session. So my button has to "send a message on the user's behalf." It works, but:

It pollutes the transcript with a turn the user didn't type (it reads like the extension is impersonating me).
It only works in an interactive session. From a non-interactive/automation run there's no agent to surface a turn, so I had to add a marker-file relay (session-request.json) that any other open interactive board claims and replays — extra moving parts for what should be one call.
I had to push the real instructions into a hidden onUserPromptSubmitted additionalContext hook just to keep the visible message clean. Clever, but clearly working around a missing API.
What I'd like
A sanctioned, capability-gated way for a canvas/extension to request host actions directly, e.g.:

session.host.createSession({ projectId, kickoffPrompt, mode }) (and friends: listProjects, openPr, openIssue, sendSessionMessage), or
a generic "request host tool invocation" bridge the user can permission-gate, so extensions can call the same orchestration tools the agent already has.
Ideally gated behind a capability flag (like elicitation is) so the host stays in control and can prompt for consent. This would let canvas buttons (Start session, open PR, jump to another session, schedule a workflow) work in one clean call — no synthetic user turns, no marker-file relays, and consistent behavior between interactive and automation contexts.

Why it matters
Canvas extensions are positioned as rich, interactive surfaces, but right now their buttons can only talk to the agent, not act on the host. Closing that gap would make them feel like first-class app UI instead of indirect prompt-injectors.

---
| Field | Value |
| --- | --- |
| App version | 1.0.2 |
| OS | Windows 10.0.26200 |
| Theme | GitHub |
| Path | /chat |
| Tenure | Week 2 |

贡献指南

打开贡献指南

调研方向

从 canvas extension JSON-RPC protocol、session.rpc namespaces 和 CopilotClient.createSession 开始,梳理 extensions 与 host capabilities 之间现有的边界。为 create_session 及相关 actions 定义一条由 capability 控制的 host-action 路径,并以直接 requests 在交互和自动化上下文中都能一致工作且无需 synthetic user turns 作为完成标准。

由索引模型根据 Issue 内容生成。

评估

技术栈
node.js
领域
api, developer-experience
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。