fix: stop forcing copilot session ids

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-28 12:52:52 +01:00
co-authored by Copilot
parent e13e3b818a
commit f459cc7291
2 changed files with 83 additions and 26 deletions
@@ -202,6 +202,45 @@ public sealed class CopilotAgentBundleTests
Assert.Equal(0.9, config.BufferExhaustionThreshold);
}
[Fact]
public void CreateSessionConfig_DoesNotForceSessionId()
{
RunTurnCommandDto command = new()
{
SessionId = "session-1",
ProjectPath = @"C:\workspace\project",
WorkspaceKind = "project",
Mode = "interactive",
Pattern = new PatternDefinitionDto
{
Id = "pattern-1",
Name = "Pattern",
Mode = "single",
Availability = "available",
Agents =
[
new PatternAgentDefinitionDto
{
Id = "agent-1",
Name = "Primary",
Model = "gpt-5.4",
Instructions = "Help.",
},
],
},
};
SessionConfig sessionConfig = CopilotAgentBundle.CreateSessionConfig(
command,
command.Pattern.Agents[0],
agentIndex: 0);
Assert.Null(sessionConfig.SessionId);
Assert.Equal(@"C:\workspace\project", sessionConfig.WorkingDirectory);
Assert.True(sessionConfig.Streaming);
Assert.NotNull(sessionConfig.Hooks);
}
[Fact]
public async Task CopilotSessionHooks_Create_UsesApprovalPolicyForPreToolUse()
{