Make dehydration stub more compact

Change from multi-line verbose format to single-line compact format:

Before:
   DEHYDRATED CONTEXT (fragment_id: 188c7ac71613)
     • 8 messages (4 user, 4 assistant)
     • 3 tool calls (shell ×3)
     • ~299 tokens saved

     To restore this history, call: rehydrate(fragment_id: "188c7ac71613")

After:
   DEHYDRATED CONTEXT: 3 tool calls (shell x3), 8 total msgs. To restore, call: rehydrate(fragment_id: "188c7ac71613")

- Combine all info into single line
- Remove tokens saved (not essential for rehydration decision)
- Use ASCII 'x' instead of '×' for simplicity
- Add 'no tool calls' case for fragments without tools
- Update related tests
This commit is contained in:
Dhanji R. Prasanna
2026-01-20 21:26:42 +05:30
parent 4321503e89
commit 9a0a2a2726
2 changed files with 14 additions and 28 deletions

View File

@@ -221,7 +221,7 @@ fn test_large_fragment() {
// Stub should still be concise
let stub = fragment.generate_stub();
assert!(stub.len() < 1000, "Stub should be concise even for large fragments");
assert!(stub.contains("200 messages"));
assert!(stub.contains("200 total msgs"));
}
/// Test fragment with tool calls