Skip to content

Commit 1ad98b5

Browse files
docs: show populated metadata exemplar in compaction event examples
🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
1 parent 3c702d8 commit 1ad98b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/contracts/CONTEXT_CONTRACT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ async def _compact_internal(self) -> None:
374374
await self._hooks.emit("context:pre_compact", {
375375
"message_count": len(self._messages),
376376
"token_count": self._token_count,
377-
"metadata": None, # Optional dict for implementation-specific data
377+
"metadata": {"strategy": "sliding_window", "trigger": "token_limit", "budget": 195000},
378378
})
379379

380380
# Build tool_call_id -> tool_use index map
@@ -417,7 +417,7 @@ async def _compact_internal(self) -> None:
417417
await self._hooks.emit("context:post_compact", {
418418
"message_count": len(self._messages),
419419
"token_count": self._token_count,
420-
"metadata": None, # Optional dict for implementation-specific data
420+
"metadata": {"budget_remaining": 97500, "storage_quota_pct": 0.42},
421421
})
422422
```
423423

0 commit comments

Comments
 (0)