-
Notifications
You must be signed in to change notification settings - Fork 317
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues, especially the pinned issues.
Exception report
-----------------------------------------------------------------------
Last 200 Keys:
s t W r i t e T i m e Space - D e s c e n d i n g Space | Space S e l e c t - O b j e c t Space - F i r s t Space 1 5 Space F u l l N a m e , Space L a s t W r i t e T i m e Enter
Enter
" ` n - - - Space E r r o r s Space ( l a s t Space 8 0 ) Space - - - " Enter
i f Space ( T e s t - P a t h Space $ E r r ) Space { Space G e t - C o n t e n t Space $ E r r Space - T a i l Space 8 0 Space } Space e l s e Space { Space " N o Space a g e n t - d a e m o n . e r r . t x t Space a t Space $ E r r " Space } Space } Enter
Alt+1
Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was -5.
at System.Console.SetCursorPosition(Int32 left, Int32 top)
at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
at Microsoft.PowerShell.PSConsoleReadLine.AcceptLineImpl(Boolean validate)
at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------
. { # Restart the agent daemon and verify it is writing fresh runs
>> $ErrorActionPreference = 'Stop'
>> $Root = (Resolve-Path ".").Path
>> $PY = (Test-Path ".\.venv\Scripts\python.exe") ? (Resolve-Path ".\.venv\Scripts\python.exe").Path : "python"
>> $Config = Join-Path $Root "config\symbols.yaml"
>> $LogDir = Join-Path $Root "runs\logs"
>> New-Item -ItemType Directory -Path $LogDir -Force | Out-Null
>> $Out = Join-Path $LogDir "agent-daemon.out.txt"
>> $Err = Join-Path $LogDir "agent-daemon.err.txt"
>>
>> "--- Stopping existing agent daemons ---"
>> $pids = Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -like "*ai_trader.cli agent daemon*" } | Select-Object -ExpandProperty ProcessId
>> foreach ($pid in $pids) { try { Stop-Process -Id $pid -Force -ErrorAction SilentlyContinue } catch {} }
>> Start-Sleep -Seconds 1
>>
>> if (-not (Test-Path $Config)) {
>> Write-Host "Config file not found at $Config" -ForegroundColor Red
>> }
>>
>> "--- Starting new agent daemon ---"
>> $Arg = "-m ai_trader.cli agent daemon --config `"$Config`" --root `"$Root`" --pop 24 --gens 8 --min-win 0.60 --warm 8 --jitter 5"
>> Start-Process -FilePath $PY -ArgumentList $Arg -WindowStyle Minimized -RedirectStandardOutput $Out -RedirectStandardError $Err
>> "RESTARTED | PY=$PY | LOGS=$Out | $Err"
>>
>> "--- Waiting for first cycle window ---"
>> Start-Sleep -Seconds 12
>>
>> "--- Running agent processes ---"
>> Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -like "*ai_trader.cli agent daemon*" } | Select-Object ProcessId, CommandLine
>>
>> "`n--- Daemon log (last 100 lines) ---"
>> if (Test-Path $Out) { Get-Content $Out -Tail 100 } else { "No agent-daemon.out.txt at $Out" }
>>
>> "`n--- Recent run snapshots ---"
>> Get-ChildItem (Join-Path $Root "runs") -Filter *.json | Sort-Object LastWriteTime -Descending | Select-Object -First 15 FullName, LastWriteTime
>>
>> "`n--- Errors (last 80) ---"
>> if (Test-Path $Err) { Get-Content $Err -Tail 80 } else { "No agent-daemon.err.txt at $Err" } }An exception occurred in custom key handler, see $error for more information: Exception calling "BackwardDeleteLine" with "0" argument(s): "The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was -5."Screenshot
The code asked me to post the error here.
Environment data
It was running in Warp ideSteps to reproduce
. { # Restart the agent daemon and verify it is writing fresh runs
$ErrorActionPreference = 'Stop'
$Root = (Resolve-Path ".").Path
$PY = (Test-Path "..venv\Scripts\python.exe") ? (Resolve-Path "..venv\Scripts\python.exe").Path : "python"
$Config = Join-Path $Root "config\symbols.yaml"
$LogDir = Join-Path $Root "runs\logs"
New-Item -ItemType Directory -Path $LogDir -Force | Out-Null
$Out = Join-Path $LogDir "agent-daemon.out.txt"
$Err = Join-Path $LogDir "agent-daemon.err.txt""--- Stopping existing agent daemons ---"
$pids = Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -like "ai_trader.cli agent daemon" } | Select-Object -ExpandProperty ProcessId
foreach ($pid in $pids) { try { Stop-Process -Id $pid -Force -ErrorAction SilentlyContinue } catch {} }
Start-Sleep -Seconds 1if (-not (Test-Path $Config)) {
Write-Host "Config file not found at $Config" -ForegroundColor Red
}"--- Starting new agent daemon ---"
$Arg = "-m ai_trader.cli agent daemon --config"$Config" --root"$Root" --pop 24 --gens 8 --min-win 0.60 --warm 8 --jitter 5"
Start-Process -FilePath $PY -ArgumentList $Arg -WindowStyle Minimized -RedirectStandardOutput $Out -RedirectStandardError $Err
"RESTARTED | PY=$PY | LOGS=$Out | $Err""--- Waiting for first cycle window ---"
Start-Sleep -Seconds 12"--- Running agent processes ---"
Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -like "ai_trader.cli agent daemon" } | Select-Object ProcessId, CommandLine"`n--- Daemon log (last 100 lines) ---"
if (Test-Path $Out) { Get-Content $Out -Tail 100 } else { "No agent-daemon.out.txt at $Out" }"`n--- Recent run snapshots ---"
Get-ChildItem (Join-Path $Root "runs") -Filter *.json | Sort-Object LastWriteTime -Descending | Select-Object -First 15 FullName, LastWriteTime"`n--- Errors (last 80) ---"
if (Test-Path $Err) { Get-Content $Err -Tail 80 } else { "No agent-daemon.err.txt at $Err" }
Oops, something went wrong. Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
Expected behavior
to run code cleanly
Actual behavior
Bugged out with the errors above