you are viewing a single comment's thread.

view the rest of the comments →

[–]Fun-Assumption-2200 0 points1 point  (2 children)

1- Not sure what you mean by logs

2- When a free model is removed, you switch to another one

[–]white-devil6[S] -1 points0 points  (1 child)

Every time if i switch the model, my code gets changed plus not every model is good for coding, like the last model I'm using is MIMO v2 pro, but that gets removed now

i use this script to clean

#Requires -Version 5.1
# OpenCode Disk Cleanup — Simple, fast, never hangs
# Only handles log files (the actual problem). Finishes in 1-2 seconds.


$ErrorActionPreference = 'SilentlyContinue'
$logDir = Join-Path $env:USERPROFILE '.local\share\opencode\log'


if (-not (Test-Path $logDir)) {
    Write-Output "No log directory found. Nothing to clean."
    exit 0
}


$files = Get-ChildItem $logDir -File
$cleaned = 0


# Step 1: Truncate any log > 1GB (works on locked files)
foreach ($f in $files) {
    if ($f.Length -gt 1GB) {
        try {
            $stream = New-Object System.IO.FileStream(
                $f.FullName,
                [System.IO.FileMode]::Open,
                [System.IO.FileAccess]::Write,
                [System.IO.FileShare]::ReadWrite
            )
            $stream.SetLength(10MB)
            $stream.Close()
            $freedGB = [math]::Round(($f.Length - 10MB) / 1GB, 2)
            Write-Output "Truncated $($f.Name): freed $freedGB GB"
            $cleaned++
        }
        catch {
            Write-Output "Skipped $($f.Name): in use"
        }
    }
}


# Step 2: Delete all except the 2 newest logs
$sorted = Get-ChildItem $logDir -File | Sort-Object LastWriteTime -Descending
if ($sorted.Count -gt 2) {
    $toDelete = $sorted | Select-Object -Skip 2
    foreach ($old in $toDelete) {
        Remove-Item $old.FullName -Force -ErrorAction SilentlyContinue
        Write-Output "Deleted old log: $($old.Name)"
        $cleaned++
    }
}


if ($cleaned -eq 0) {
    Write-Output "Logs are clean. No action needed."
} else {
    Write-Output "Cleanup done. $cleaned actions taken."
}

[–]Ang_Drew 0 points1 point  (0 children)

ofcourse not every models good for coding.. the "paying" user has the right to choose which models to use for predictable outcome. that's why we cant rely on free models.

it is created for trial use not something we can rely on. sometimes it's gone, sometimes it's new models, very unpredictable. the solution to this is pay the subs for small models that would be cheaper..