github / github/app

Canvas extension sendAttachmentsToMessage succeeds but Desktop does not surface or forward attachments

Open
#3,832 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
2.1k
Forks
157
PR merge metrics
No merged PRs in 30d

Description

Affected version or release

GitHub Copilot app v1.1.20
@github/copilot-sdk 1.0.13
Bundled Copilot CLI 1.0.83
macOS 26.6.2 (arm64)

Installation context

A local Canvas extension loaded from .github/extensions in a local GitHub Copilot app session.

What happened?

I am trying to understand the supported behavior of session.rpc.extensions.sendAttachmentsToMessage() in the GitHub Copilot desktop app.

The generated SDK documentation says that the method pushes attachments into the next user-message turn, and that the host should:

  1. Surface them as composer pills.
  2. Forward them through the next session.send call.

The RPC resolves successfully when called from an extension-owned connection, but the Desktop composer does not display a pill. When I manually submit the next prompt, the model reports that no attachment is present.

Calling session.send({ prompt }) from the extension immediately after the successful push also sends the prompt without the pushed attachment.

In contrast, passing SVG blobs directly in the same session.send request works correctly. Desktop displays SVG thumbnails and the model can read their contents.

Steps to reproduce

  1. Create a Canvas extension and join the foreground session:

    const session = await joinSession({
      canvases: [canvas],
    })
    
  2. From a Canvas action or loopback request, call:

    await session.rpc.extensions.sendAttachmentsToMessage({
      instanceId,
      attachments: [
        {
          type: 'extension_context',
          title: '2 Icon Studio references',
          payload: {
            kind: 'icon-studio-references',
            icons: [
              { name: 'Gears', svg: '<svg>...</svg>' },
              { name: 'Icon Settings', svg: '<svg>...</svg>' },
            ],
          },
        },
      ],
    })
    
  3. Observe that the call resolves without an error, but no attachment pill appears in the Desktop composer.

  4. Manually send a prompt asking the model to inspect the attachment.

  5. Observe that the model reports that no attachment is present.

  6. As an additional test, call this immediately after the push:

    await session.send({
      prompt: 'Analyze the attached Icon Studio references.',
    })
    
  7. The prompt appears in the conversation, but it still has no attachment.

  8. Replace both calls with a single direct send:

    await session.send({
      prompt: 'Analyze the attached SVG Icon Studio references.',
      attachments: icons.map((icon) => ({
        type: 'blob' as const,
        data: Buffer.from(icon.svg, 'utf8').toString('base64'),
        mimeType: 'image/svg+xml',
        displayName: `${icon.name}.svg`,
      })),
    })
    
  9. This works: Desktop displays both SVG thumbnails and the model can read their contents. The runtime materializes them under /tmp/icon-studio-svgs/.

Expected behavior

After sendAttachmentsToMessage resolves:

  • Desktop should display the pushed attachments as composer pills.
  • The attachments should be included when the user submits the next prompt.
  • Removing a pill should prevent that attachment from being sent.

If this API is not currently supported by the Desktop host, the documentation should clarify its supported hosts and recommend the appropriate Canvas extension workflow.

Additional context

The extension receives no error from sendAttachmentsToMessage.

Questions:

  1. Is session.extensions.sendAttachmentsToMessage supported by GitHub Copilot desktop app v1.1.20?
  2. Does Desktop currently consume the ephemeral session.extensions.attachments_pushed event?
  3. Is a feature flag, capability, manifest field, or particular attachment type required?
  4. Is the extension expected to call session.send itself? If so, how should it obtain and forward the runtime-stamped extension_context attachment?
  5. Is direct session.send({ prompt, attachments: blob[] }) the recommended fallback for Canvas extensions?

Related SDK PR: https://github.com/github/copilot-sdk/pull/1502

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the sendAttachmentsToMessage() and session.send() entry points, then review related SDK PR #1502 and the attachments_pushed event handling. Reproduce the Canvas extension flow and verify whether Desktop surfaces the attachments, includes them in the next send, and honors pill removal; if unsupported, document the supported hosts and direct-send fallback.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.