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 @@ This file tracks all major tracks for the project. Each track has its own detail
4. [x] **Track: Robust JSON Parsing for Tech Lead**
*Link: [./tracks/robust_json_parsing_tech_lead_20260302/](./tracks/robust_json_parsing_tech_lead_20260302/)*
5. [ ] **Track: Concurrent Tier Source Isolation**
5. [~] **Track: Concurrent Tier Source Isolation**
*Link: [./tracks/concurrent_tier_source_tier_20260302/](./tracks/concurrent_tier_source_tier_20260302/)*
6. [ ] **Track: Manual UX Validation & Polish**

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.