Skip to content

Create references - Expected Property Values & BUG: Required Properties #119

Open
@RickardHF

Description

As per the current documentation a reference can be created as such (included for easier reference)

import { createReferencesEvent } from "@copilot-extensions/preview-sdk";

response.write(
  createReferencesEvent([
    {
      id: "123",
      type: "issue",
      data: {
        number: 123,
      },
      is_implicit: false,
      metadata: {
        display_name: "My issue",
        display_icon: "issue-opened",
        display_url: "https://github.com/monalisa/hello-world/issues/123",
    },
  ])
);

Expected Property Values

The property .type is one of the required properties. However it is not clear how this is expected to be used, what values are expected etc.
Is this just to be able to detect it later if this reference is later added to the chat so that one can handle this reference differently?

The property .data is optional, but what is the use of this?

Based on the naming of the propery .metadata.display_icon one would expect this should influence how the reference is rendered in the agent, webUI etc - are there standard values that would be "accepted" by the copilot extensions?

Could you improve the documentation on these?

Possible Bug - Optional Properties are Required

Using the sdk to provide references we found it caused errors for both the VS Code agent, and the GitHub web agent if the following properties were not included:

  • .data - If this property wasn't included in the response, the rendering of the references would fail. It could be an empty object, but it neeeded to be set.
  • .metadata - If this property wasn`t set rendering failed.

Both of these properties are marked as optional in the documentation. While omitting them doesn't cause any errors on the API, it causes errors on at least two different agents ( VSCode and GitHub Web )

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions