conductor(checkpoint): Phase 4: Final Validation and Reporting complete
This commit is contained in:
@@ -24,6 +24,21 @@ $SystemPrompts = @{
|
||||
$SelectedPrompt = $SystemPrompts[$Role]
|
||||
$SafePrompt = "$SelectedPrompt`n`nUSER PROMPT:`n$Prompt"
|
||||
|
||||
# Ensure log directory exists
|
||||
if (-not (Test-Path "logs")) { New-Item -ItemType Directory -Path "logs" | Out-Null }
|
||||
$LogFile = "logs/mma_delegation.log"
|
||||
$Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
||||
|
||||
$LogEntry = @"
|
||||
--------------------------------------------------
|
||||
TIMESTAMP: $Timestamp
|
||||
TIER: $Role
|
||||
SYSTEM PROMPT: $SelectedPrompt
|
||||
USER PROMPT: $Prompt
|
||||
--------------------------------------------------
|
||||
"@
|
||||
$LogEntry | Out-File -FilePath $LogFile -Append
|
||||
|
||||
if ($ShowContext) {
|
||||
Write-Host "`n[MMA ORCHESTRATOR] Spawning Tier: $Role" -ForegroundColor Cyan
|
||||
Write-Host "[MMA SYSTEM PROMPT]:`n$SelectedPrompt" -ForegroundColor Gray
|
||||
@@ -43,13 +58,18 @@ try {
|
||||
$cleanJsonString = $fullString.Substring($jsonStartIndex)
|
||||
$parsed = $cleanJsonString | ConvertFrom-Json
|
||||
|
||||
# Log response
|
||||
"RESPONSE:`n$($parsed.response)" | Out-File -FilePath $LogFile -Append
|
||||
|
||||
# Output only the clean response text
|
||||
Write-Output $parsed.response
|
||||
} else {
|
||||
"ERROR: No JSON found in output.`n$fullString" | Out-File -FilePath $LogFile -Append
|
||||
Write-Warning "No JSON object found in output."
|
||||
Write-Output $fullString
|
||||
}
|
||||
} catch {
|
||||
"FATAL ERROR: Parsing failed.`n$_" | Out-File -FilePath $LogFile -Append
|
||||
# Fallback if parsing fails
|
||||
Write-Warning "Failed to parse JSON from sub-agent. Raw output:"
|
||||
Write-Output $jsonOutput
|
||||
|
||||
Reference in New Issue
Block a user