Skip to content

"Vibe-Trading: Your Personal Trading Agent"

perf(redaction): cache _internal_roots() to avoid recomputation per call

Haozhe Wu2f9fa22a5661
diff --git a/agent/src/tools/redaction.py b/agent/src/tools/redaction.py
index f5cb9a77b..24973133c 100644
--- a/agent/src/tools/redaction.py
+++ b/agent/src/tools/redaction.py
@@ -11,11 +11,13 @@ from __future__ import annotations
import sys
import sysconfig
+from functools import cache
from pathlib import Path
_SENTINEL = "<redacted>"
+@cache
def _internal_roots() -> list[str]:
# AGENT_DIR derived like agent/src/providers/llm.py:90
# (Path(__file__).resolve().parents[2]); redaction.py is agent/src/tools/