Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Feature request: allow seeding a new session with conversation history

オープン
#886 コメント 1 件 リアクション 6 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
csharp, java
領域
api

調査の方向性

リクエストに記載されたエントリポイント SessionConfig、CreateSessionAsync、SendAsync から開始し、セッションの会話状態がどのように初期化されるかを追跡します。最初の SendAsync の前に、呼び出し元が InitialMessages を通じてユーザーとアシスタントのロール/コンテンツのペアを指定でき、モデルがそれらを会話履歴として扱えば完了です。

索引モデルが issue の本文から書いたものです。

説明

Problem

The Copilot SDK uses a session-based model where the session owns the conversation state. This works well when the SDK controls the full conversation lifecycle, but doesn't fit applications that manage conversation history externally. An example is applications that allow the user or harness to rewind, edit, condense or restructure prior turns.

In these cases, the only option is to format prior messages into the prompt text with role markers like [User] / [Assistant] and explain the convention in the system message. This works but is far from ideal, because the model may not treat text labeled as its own prior output with the same status as actual assistant-role messages, and creates confusion if the user's text includes what could be interpreted as unbalanced delimiters (such as ``` without a closing fence).

The SDK's session resumption feature (ResumeSessionAsync) doesn't help here because the caller needs to be able to arbitrarily reshape the history on every turn.

Proposed solution

Add an InitialMessages property to SessionConfig - a list of role/content pairs that seed the session's conversation history before the first SendAsync call:

var session = await client.CreateSessionAsync (new SessionConfig
{
    InitialMessages = new List<SessionMessage>
    {
        new ("user", "Explain async/await in C#"),
        new ("assistant", "Async/await is a pattern for..."),
    },
    // ...
}); 

The messages would be treated as real conversation history by the model - not as text stuffed into a user prompt.

Note that the history seed doesn't necessarily have to support every feature of every kind of message. Simply having the ability to specify the role (user/assistant) and text would be incredibly useful.

主要言語
Java
スター
10.5k
フォーク
1.5k
平均マージ
1日 9時間
マージ済み PR(30日)
131

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/copilot-sdk のほかの issue

github/copilot-sdk の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。