fix(ui): remove stale parked session note (#3900)
This commit is contained in:
@@ -314,6 +314,7 @@ func (a *mockAgent) LoadSession(ctx context.Context, req acp.LoadSessionRequest)
|
||||
return acp.LoadSessionResponse{}, ctx.Err()
|
||||
}
|
||||
}
|
||||
sessionMCPServers := registerACPMcpServers(req.McpServers)
|
||||
a.mu.Lock()
|
||||
if a.sessions == nil {
|
||||
a.sessions = make(map[acp.SessionId]bool)
|
||||
@@ -324,7 +325,11 @@ func (a *mockAgent) LoadSession(ctx context.Context, req acp.LoadSessionRequest)
|
||||
if a.commandsEmitted == nil {
|
||||
a.commandsEmitted = make(map[acp.SessionId]bool)
|
||||
}
|
||||
if a.sessionMCPServers == nil {
|
||||
a.sessionMCPServers = make(map[acp.SessionId]map[string]mcpServerDef)
|
||||
}
|
||||
a.sessions[req.SessionId] = true
|
||||
a.sessionMCPServers[req.SessionId] = cloneMCPServerDefs(sessionMCPServers)
|
||||
configOptions, ok := a.sessionConfig[req.SessionId]
|
||||
if !ok {
|
||||
a.sessionConfig[req.SessionId] = mockSessionConfigOptions()
|
||||
|
||||
@@ -73,6 +73,41 @@ func TestLoadSessionReturnsCapabilitiesForResumedSession(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadSessionRetainsMCPServersForResumedPrompt(t *testing.T) {
|
||||
sessionID := acp.SessionId("session-load-mcp-test")
|
||||
priorServers := mcpServers
|
||||
mcpServers = nil
|
||||
t.Cleanup(func() { mcpServers = priorServers })
|
||||
agent := &mockAgent{
|
||||
conn: &promptCancelUpdater{started: make(chan struct{})},
|
||||
sessions: make(map[acp.SessionId]bool),
|
||||
sessionConfig: make(map[acp.SessionId][]acp.SessionConfigOption),
|
||||
sessionMCPServers: make(map[acp.SessionId]map[string]mcpServerDef),
|
||||
commandsEmitted: make(map[acp.SessionId]bool),
|
||||
}
|
||||
request := acp.LoadSessionRequest{
|
||||
SessionId: sessionID,
|
||||
McpServers: []acp.McpServer{{
|
||||
Sse: &acp.McpServerSseInline{
|
||||
Name: "resumed-test",
|
||||
Type: "sse",
|
||||
Url: "http://127.0.0.1:1/sse",
|
||||
},
|
||||
}},
|
||||
}
|
||||
|
||||
if _, err := agent.LoadSession(context.Background(), request); err != nil {
|
||||
t.Fatalf("LoadSession() error = %v", err)
|
||||
}
|
||||
server, ok := agent.sessionMCPServers[sessionID]["resumed-test"]
|
||||
if !ok {
|
||||
t.Fatal("LoadSession() did not retain MCP server for the resumed session")
|
||||
}
|
||||
if server.URL != "http://127.0.0.1:1/sse" {
|
||||
t.Fatalf("resumed MCP server URL = %q, want %q", server.URL, "http://127.0.0.1:1/sse")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSetSessionConfigOptionRejectsUnknownValue(t *testing.T) {
|
||||
sessionID := acp.SessionId("session-config-test")
|
||||
agent := &mockAgent{
|
||||
|
||||
Reference in New Issue
Block a user