Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Feature request: allow seeding a new session with conversation history

Abierto
#886 1 comentario 6 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
csharp, java
Área
api

Línea de trabajo

Comience por los puntos de entrada SessionConfig, CreateSessionAsync y SendAsync mencionados en la solicitud y, a continuación, siga cómo se inicializa el estado de la conversación de la sesión. Se considera completado cuando los autores de las llamadas pueden proporcionar pares de rol y contenido de usuario y asistente mediante InitialMessages antes del primer SendAsync, y el modelo los trata como historial de conversación.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Java
Estrellas
10.5k
Forks
1.5k
Merge medio
1 d 9 h
PR fusionados (30 d)
131

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de github/copilot-sdk

Todos los issues de github/copilot-sdk

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.