mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-27 19:25:15 +02:00
feat(agents): track permission and compaction events
This commit is contained in:
parent
ea3d0a6463
commit
53691f9c51
4 changed files with 10 additions and 0 deletions
|
|
@ -34,6 +34,7 @@ from deepagents.middleware.summarization import (
|
|||
)
|
||||
from langchain_core.messages import SystemMessage
|
||||
|
||||
from app.observability import metrics as ot_metrics
|
||||
from app.observability import otel as ot
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -178,6 +179,7 @@ class SurfSenseCompactionMiddleware(SummarizationMiddleware):
|
|||
messages_in=len(conversation_messages),
|
||||
extra={"compaction.cutoff_index": int(cutoff_index)},
|
||||
):
|
||||
ot_metrics.record_compaction_run(reason="auto")
|
||||
messages_to_summarize, preserved_messages = super()._partition_messages(
|
||||
conversation_messages, cutoff_index
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue