Skip to content

Commit 1b1d8fb

Browse files
committed
Fix infiniteSessions example to use correct property names
- Use backgroundCompactionThreshold instead of compactionThreshold.background - Use bufferExhaustionThreshold instead of compactionThreshold.blocking - Values are 0.0-1.0 utilization ratios, not absolute token counts - Add note clarifying the value range
1 parent 7279c6f commit 1b1d8fb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

docs/compatibility.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,14 @@ Instead of `/compact`, configure automatic compaction:
159159
const session = await client.createSession({
160160
infiniteSessions: {
161161
enabled: true,
162-
compactionThreshold: {
163-
background: 80000, // Compact in background at 80k tokens
164-
blocking: 100000, // Block and compact at 100k tokens
165-
},
162+
backgroundCompactionThreshold: 0.80, // Start background compaction at 80% context utilization
163+
bufferExhaustionThreshold: 0.95, // Block and compact at 95% context utilization
166164
},
167165
});
168166
```
169167

168+
> **Note:** Thresholds are context utilization ratios (0.0-1.0), not absolute token counts.
169+
170170
## Protocol Limitations
171171

172172
The SDK can only access features exposed through the CLI's JSON-RPC protocol. If you need a CLI feature that's not available:

0 commit comments

Comments
 (0)