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

@@ -3,8 +3,8 @@
> **TEST DEBT FIX:** Due to ongoing test architecture instability (documented in `test_architecture_integrity_audit_20260304`), do NOT write new `live_gui` integration tests for this track. Rely strictly on in-process `unittest.mock` for `ai_client` concurrency verification.
## Phase 1: Thread-Local Context Refactoring
- [ ] Task: Initialize MMA Environment `activate_skill mma-orchestrator`
- [ ] Task: Refactor `ai_client` to `threading.local()`
- [x] Task: Initialize MMA Environment `activate_skill mma-orchestrator`
- [~] Task: Refactor `ai_client` to `threading.local()`
- [ ] WHERE: `ai_client.py`
- [ ] WHAT: Replace `current_tier = None` with `_local_context = threading.local()`. Implement safe getters/setters for the tier.
- [ ] HOW: Use standard `threading.local` attributes.