feat(mma): Phase 1 — source_tier tagging at emission
- ai_client: add current_tier module var; stamp source_tier on every _append_comms entry - multi_agent_conductor: set current_tier='Tier 3' around send(), clear in finally - conductor_tech_lead: set current_tier='Tier 2' around send(), clear in finally - gui_2: _on_tool_log captures current_tier; _append_tool_log stores dict with source_tier - tests: 8 new tests covering current_tier, source_tier in comms, tool log dict format
This commit is contained in:
16
ai_client.py
16
ai_client.py
@@ -89,6 +89,9 @@ comms_log_callback: Callable[[dict[str, Any]], None] | None = None
|
||||
# Signature: (script: str, result: str) -> None
|
||||
tool_log_callback: Callable[[str, str], None] | None = None
|
||||
|
||||
# Set by caller tiers before ai_client.send(); cleared in finally.
|
||||
# Safe — ai_client.send() calls are serialized by the MMA engine executor.
|
||||
current_tier: str | None = None
|
||||
# Increased to allow thorough code exploration before forcing a summary
|
||||
MAX_TOOL_ROUNDS: int = 10
|
||||
|
||||
@@ -134,12 +137,13 @@ COMMS_CLAMP_CHARS: int = 300
|
||||
|
||||
def _append_comms(direction: str, kind: str, payload: dict[str, Any]) -> None:
|
||||
entry = {
|
||||
"ts": datetime.datetime.now().strftime("%H:%M:%S"),
|
||||
"direction": direction,
|
||||
"kind": kind,
|
||||
"provider": _provider,
|
||||
"model": _model,
|
||||
"payload": payload,
|
||||
"ts": datetime.datetime.now().strftime("%H:%M:%S"),
|
||||
"direction": direction,
|
||||
"kind": kind,
|
||||
"provider": _provider,
|
||||
"model": _model,
|
||||
"payload": payload,
|
||||
"source_tier": current_tier, # set/cleared by caller tiers; None for main-session calls
|
||||
}
|
||||
_comms_log.append(entry)
|
||||
if comms_log_callback is not None:
|
||||
|
||||
Reference in New Issue
Block a user