Watch
1
0
Fork
You've already forked souveraine
0

docs: add task files for deferred safety/enhancement work

- 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
This commit is contained in:
Fimeg 2026-06-15 15:42:31 -04:00
commit 19b8566e4d
4 changed files with 198 additions and 0 deletions

View file

@ -0,0 +1,47 @@
# 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:
```rust
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
1. **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)
2. **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
## API Design Notes
- Check `src/server/conversation.rs` for 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_conversations` returns real data from the server
- [ ] `load_conversation` returns full message history
- [ ] Both methods handle errors gracefully (network, 404, auth)
- [ ] Tests cover happy path and error cases