You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature] Strip unused per-message fields from the session API response #307
Problem / motivation
Opening a long session is slow over a remote link because GET /api/sessions/[id] sends large per-message fields the UI never reads:
inputTransformations: each assistant message carries its own list of up to ~220 entries like {"type":"thinking_dropped","path":"messages.N.content.M","reason":"prefix_binding_mismatch"}
thinkingSignature: still sent with deferThinking=1, even though thinking itself is blanked; it is opaque base64 and barely compresses
requestControls
contextSnapshot
On a long session (597 messages, with the client's own ?deferThinking=1&deferMedia=1):
Raw
gzip
Current
3.7 MB
881 KB
Without these 4 fields
1.6 MB
530 KB
inputTransformations alone is 53% of the response.
Proposed solution
Drop these four fields in buildSessionContext() (lib/session-reader.ts) when building the response, at least when deferThinking is set. Nothing in components/, hooks/, lib/ or app/ reads them.
Alternatives considered
Compressing at a reverse proxy: this helps, but the payload is still about 0.9 MB after gzip, and thinkingSignature barely compresses.
Paginating the session context: this would help more, but it is a much larger change. Removing unused fields is small and independent of it.
I'll fix this — the four unused per-message fields will be dropped from the display context in entryToUiMessage (next to the existing stripToolResultDetails), so both the session context route and the history page stop sending them. I verified no code in components/, hooks/, lib/ or app/ reads them, and the on-disk session file keeps the full message. Opening a PR with the fix plus a test pinning the fields absent.
Activity
anhnt256 commentedon Nov 11, 2026
I'll fix this — the four unused per-message fields will be dropped from the display context in
entryToUiMessage(next to the existingstripToolResultDetails), so both the session context route and the history page stop sending them. I verified no code in components/, hooks/, lib/ or app/ reads them, and the on-disk session file keeps the full message. Opening a PR with the fix plus a test pinning the fields absent.Merge pull request ompweb-dev#454 from anhnt256/perf/strip-unused-ses…