Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Model property in session is ignored #250

@cm4ker

Description

@cm4ker

SDK.NET

Hi! I have some unexpected behaviour:

app.cs

#:package GitHub.Copilot.SDK@*

using GitHub.Copilot.SDK;

await using var client = new CopilotClient();
await client.StartAsync();

var session = await client.CreateSessionAsync(new SessionConfig
{
    Model = "SOME_MODEL_THAT_NOT_EXISTS",
});

var done = new TaskCompletionSource();

session.On(evt =>
{
    switch (evt)
    {
        case AssistantMessageEvent msg:
            Console.WriteLine($"\nCopilot: {msg.Data.Content}");
            break;
        case SessionIdleEvent ev:
            Console.WriteLine("Session is idle.");
            done.SetResult();
            break;
    }
});

await session.SendAsync(new MessageOptions
{
    Prompt = "Can you write a story?"
});

await done.Task;

dotnet run app.cs


Copilot: I'd be happy to write a story for you! Here's a short one:

---

**The Last Library**

Maya found the building by accident, half-buried beneath centuries of sand. The sign was still legible: *Public Library*.

Inside, dust motes danced in shafts of sunlight piercing the cracked ceiling. Rows of shelves stood like ancient sentinels, their contents miraculously preserved by the desert's dry embrace.

She ran her fingers along leather spines, pulling one free. The pages crackled as she opened it—a cookbook from 2024. Another book showed children playing in green parks. Another described something called "rain."

Maya had only seen water rationed in plastic pouches. She had never seen a tree that wasn't synthetic.

She spent hours there, discovering a world where people worried about things like traffic and what to cook for dinner. Small problems. Beautiful problems.

When she finally emerged, the twin suns were setting. Under her arm: three books. In her chest: something dangerous.

Hope.

---

Would you like me to write a different type of story, or is there something specific you'd like me to help you with in this project directory?
Session is idle.

Expected throw exception, that model 'SOME_MODEL_THAT_NOT_EXISTS' is not found.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions