fix(webui): retain system context graph after compaction (#6608)
This commit is contained in:
1 parent
d789e1bfc7
commit
4212ad726d
25 files changed
+748
-102
No files matched your search
@@ -21,6 +21,7 @@ from uuid import uuid4
|
||||
from loguru import logger
|
||||
|
||||
from nanobot.agent.context import TranscriptInput
|
||||
from nanobot.context_sources import drain_system_sources
|
||||
from nanobot.events import NO_EVENTS, ContextCompactionEvent, EventSink
|
||||
from nanobot.providers.base import (
|
||||
CONTEXT_SAFETY_BUFFER,
|
||||
@@ -706,13 +707,18 @@ class ContextGovernor:
|
||||
),
|
||||
)
|
||||
raise
|
||||
await state.events.emit(
|
||||
ContextCompactionEvent(
|
||||
compaction_id=compaction_id,
|
||||
phase="succeeded",
|
||||
reason="context_pressure",
|
||||
),
|
||||
)
|
||||
async def publish_success() -> None:
|
||||
if (sources := drain_system_sources()) is not None:
|
||||
await state.events.emit(sources)
|
||||
await state.events.emit(
|
||||
ContextCompactionEvent(
|
||||
compaction_id=compaction_id,
|
||||
phase="succeeded",
|
||||
reason="context_pressure",
|
||||
),
|
||||
)
|
||||
|
||||
await shield_and_drain(publish_success())
|
||||
return prepared
|
||||
|
||||
async def prepare_request(
|
||||
|
||||
Reference in new issue
Block a user