- remote-conversation-loading.md — implement list/load for RemoteBackend - settings-error-display.md — wire validation errors to footer - dead-code-cleanup.md — remove allow(dead_code), Letta aliases, unused imports - numeric-cast-safety.md — add saturating cast helpers
1.6 KiB
1.6 KiB
Task: Implement Remote Conversation Listing and Loading
Priority: Medium
Effort: 2-4 hours
Files: src/backend/remote.rs
Context
The RemoteBackend has two stub methods:
async fn list_conversations(&self, _agent_id: &str) -> Result<Vec<ConversationInfo>> {
Ok(Vec::new()) // TODO
}
async fn load_conversation(&self, _conversation_id: &str) -> Result<Vec<ConversationMessage>> {
anyhow::bail!("Remote conversation loading not yet implemented")
}
Anyone using the remote backend gets empty conversation history and an error on load.
Requirements
-
list_conversations — Implement
GET /v1/agents/:id/conversations:- Deserialize response into
Vec<ConversationInfo> - Handle pagination if the API supports it
- Return empty vec on 404 (agent has no conversations yet)
- Deserialize response into
-
load_conversation — Implement
GET /v1/conversations/:id/messages:- Deserialize response into
Vec<ConversationMessage> - Handle SSE streaming if the API streams messages
- Return clear error if conversation doesn't exist
- Deserialize response into
API Design Notes
- Check
src/server/conversation.rsfor the server-side endpoints - The server may already implement these — just wire the client
- Use the existing
auth_req()pattern for bearer token injection - Follow the
send()method's SSE parsing pattern if streaming is needed
Acceptance Criteria
list_conversationsreturns real data from the serverload_conversationreturns full message history- Both methods handle errors gracefully (network, 404, auth)
- Tests cover happy path and error cases