Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions goose-ios/Goose/GooseAPIService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,9 @@ class GooseAPIService: ObservableObject {
throw APIError.httpError(httpResponse.statusCode, errorBody)
}

// /agent/resume returns Session but with conversation=null when not loading messages
// We don't need messages here anyway since we're just activating the agent
let session = try JSONDecoder().decode(SessionResponse.self, from: data)

return (session.id, [])
let resumeResponse = try JSONDecoder().decode(ResumeAgentResponse.self, from: data)

return (resumeResponse.session.id, [])
}
catch let error as DecodingError {
handleAPIError(APIError.decodingError(error), context: "Resume Agent")
Expand Down Expand Up @@ -716,6 +714,10 @@ struct SessionResponse: Codable {
let conversation: [Message]?
}

struct ResumeAgentResponse: Codable {
let session: SessionResponse
}

struct SessionsResponse: Codable {
let sessions: [ChatSession]
}
Expand Down