M1: History Pagination + Lightweight History Mode (Daemon + IPC)#9227
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Devin Review found 1 potential issue.
🐛 1 issue in files not directly in the diff
🐛 HTTPDaemonClient constructs history_response payload missing required hasMore field, causing deserialization failure (clients/shared/IPC/HTTPDaemonClient.swift:488-492)
The HTTPDaemonClient.swift manually constructs a history_response JSON payload at line 488-492 with only type, sessionId, and messages — but IPCHistoryResponse.hasMore is now a required (non-optional) Bool field. When JSONDecoder().decode(ServerMessage.self, from: historyData) runs at line 495, it will throw a DecodingError.keyNotFound because the mandatory hasMore key is absent, causing the entire HTTP-based history fetch to silently fail (caught at line 498-499 and logged as an error).
Root Cause
The HistoryResponse contract in assistant/src/daemon/ipc-contract/sessions.ts:279 changed hasMore from non-existent to a required field (hasMore: boolean). The generated Swift type IPCHistoryResponse at clients/shared/IPC/Generated/IPCContractGenerated.swift:1973 mirrors this as public let hasMore: Bool (non-optional). However, clients/shared/IPC/HTTPDaemonClient.swift:488-492 manually builds the JSON dict:
let historyPayload: [String: Any] = [
"type": "history_response",
"sessionId": sessionId,
"messages": transformed
]This dict lacks hasMore, so decoding fails. All clients using the HTTP transport path (remote daemon connections) will be unable to load conversation history.
View 5 additional findings in Devin Review.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ebe2546c4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Addressed in #9246 |
Part of #9219. Extends history_request with pagination (limit, beforeTimestamp) and lightweight mode (mode, includeAttachments, includeToolImages, includeSurfaceData). Adds hasMore and oldestTimestamp to history_response. Implements server-side filtering to strip heavy payloads in light mode.