Files
biblioteca_conocimiento_lab…/scripts/check_omniroute_fix.ps1

40 lines
1.5 KiB
PowerShell

# Comprueba si el bug de opencode que impide a los plugins registrar
# providers fuera del catalogo models.dev (OmniRoute) ya esta arreglado.
#
# Issues: anomalyco/opencode #38839 (provider hook skipped for non-catalog providers)
# anomalyco/opencode #25630 (regression: provider.models() no puebla)
#
# Si alguno se cierra, escribe documentacion/omniroute_fix_fixed.flag
# y lo deja registrado para avisar al usuario en la proxima sesion / `re`.
$ErrorActionPreference = "SilentlyContinue"
$repoRoot = Split-Path -Parent $PSScriptRoot
$docDir = Join-Path $repoRoot "documentacion"
$flagFile = Join-Path $docDir "omniroute_fix_fixed.flag"
$logFile = Join-Path $docDir "omniroute_fix_status.txt"
$issues = @(38839, 25630)
$headers = @{ "User-Agent" = "omniroute-fix-check"; "Accept" = "application/vnd.github+json" }
$lines = @()
$fixed = $false
foreach ($n in $issues) {
try {
$r = Invoke-RestMethod -Uri "https://api.github.com/repos/anomalyco/opencode/issues/$n" -Headers $headers -TimeoutSec 20
$state = $r.state
$title = $r.title
$lines += "[$(Get-Date -Format 'yyyy-MM-dd HH:mm')] #$n state=$state :: $title"
if ($state -eq "closed") { $fixed = $true }
} catch {
$lines += "[$(Get-Date -Format 'yyyy-MM-dd HH:mm')] #$n ERROR: $($_.Exception.Message)"
}
}
$lines | Out-File -FilePath $logFile -Append -Encoding utf8
if ($fixed -and -not (Test-Path $flagFile)) {
"Bug opencode OmniRoute ARREGLADO (ver $logFile)" | Out-File -FilePath $flagFile -Encoding utf8
}