feat(ai_client): isolation of current_tier using threading.local() for parallel agent safety

This commit is contained in:
2026-03-06 12:59:10 -05:00
parent 1fb6ebc4d0
commit 684a6d1d3b
11 changed files with 75 additions and 29 deletions

View File

@@ -20,7 +20,7 @@ def generate_tickets(track_brief: str, module_skeletons: str) -> list[dict[str,
# Set custom system prompt for this call
old_system_prompt = ai_client._custom_system_prompt
ai_client.set_custom_system_prompt(system_prompt or "")
ai_client.current_tier = "Tier 2"
ai_client.set_current_tier("Tier 2")
last_error = None
try:
for _ in range(3):
@@ -53,7 +53,7 @@ def generate_tickets(track_brief: str, module_skeletons: str) -> list[dict[str,
finally:
# Restore old system prompt and clear tier tag
ai_client.set_custom_system_prompt(old_system_prompt or "")
ai_client.current_tier = None
ai_client.set_current_tier(None)
from src.dag_engine import TrackDAG
from src.models import Ticket