## Why
The baseline for comparing additional context submissions lived in memory,
so resuming a conversation could append context that was already in its
history.
## What changed
Persist the rendered fingerprints and history item IDs for active context
entries in world state. Reuse unchanged entries across turns and resumes,
and use their IDs to restore active items during compaction.
A client submission replaces the active set. Tool-provided context updates
only its own keys and is recorded after tool results, before the next
prompt.
## Testing
Extend scenario coverage to check deduplication after resume for both
message and tool-output rendering. Verify that edits in the truncated
portion of application context do not produce duplicate developer messages.
GitOrigin-RevId: 12a65a70d871f8dcefa082825c0ec4e9446efb56
## Why
Compaction can drop active client context while deduplication prevents unchanged values from being sent again on subsequent turns.
## What changed
Track additional context by history item ID and restore active items when installing complete or prefix compaction results. Preserve their history order, refresh retained items with their original bounded payloads, and leave queued updates to arrive with their input.
## Testing
Add regression coverage for local compaction with message context and remote compaction with tool-output context. Verify that current context survives exactly once, stale values are absent, and restored context precedes the preserved user prompt.
GitOrigin-RevId: a3114f387c6a4ae1a2d1651993d0f7a101be7dd5