Compare commits

..

7 Commits

Author SHA1 Message Date
Nathan
713243685a begin overhaul 2025-12-17 15:37:32 -07:00
Nathan
5c3a12ed0e attempt fix 2025-12-17 15:09:56 -07:00
Nathan
428d9bac6b remote controller working! 2025-12-02 16:23:31 -07:00
Nathan
e568e02cdf fix opt 6 exit not working
also continue fix attempt on sheepit not starting
2025-12-02 12:08:00 -07:00
18683b4ad0 attachment is clean 2025-12-01 15:52:35 -07:00
Nathan
b61baac09b attempting fix 2025-11-26 18:18:13 -07:00
Nathan
2aa9061114 begin persistence/attachment overhaul 2025-11-25 14:51:22 -07:00
12 changed files with 19870 additions and 5215 deletions

View File

@@ -22,7 +22,7 @@ Im crafting the remote PowerShell snippet to start SheepIt asynchronously so
<tool-use data-tool-type="generic" data-tool-name="list_dir">
<details>
<summary>Tool use: **list_directory** • Listed directory undefined • **0** results</summary>
<summary>Tool use: **list_dir** • Listed directory, 0 results</summary>
No results found
</details>
@@ -48,66 +48,66 @@ Im wrapping up the main loop with clear menu options and proper input handlin
*** Add File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
+function Show-Header {
+ Clear-Host
+ Write-Host &quot;====================================&quot; -ForegroundColor Cyan
+ Write-Host &quot; UNIFIED SHEEPIT LAUNCHER&quot; -ForegroundColor Cyan
+ Write-Host &quot;====================================&quot; -ForegroundColor Cyan
+ Write-Host "====================================" -ForegroundColor Cyan
+ Write-Host " UNIFIED SHEEPIT LAUNCHER" -ForegroundColor Cyan
+ Write-Host "====================================" -ForegroundColor Cyan
+ Write-Host
+}
+
+$defaultSheepItPath = &quot;C:\Users\Nathan\Desktop\sheepit-autoupdate.exe&quot;
+$defaultSheepItPath = "C:\Users\Nathan\Desktop\sheepit-autoupdate.exe"
+
+$workers = @(
+ @{ ID = 1; Name = &quot;i9kf&quot;; SSHArgs = &quot;-t i9kf&quot;; SheepItPath = $defaultSheepItPath; Enabled = $false },
+ @{ ID = 2; Name = &quot;blender-boss&quot;; SSHArgs = &quot;-t blender-boss&quot;; SheepItPath = $defaultSheepItPath; Enabled = $true },
+ @{ ID = 3; Name = &quot;max&quot;; SSHArgs = &quot;-t max&quot;; SheepItPath = $defaultSheepItPath; Enabled = $true },
+ @{ ID = 4; Name = &quot;masterbox&quot;; SSHArgs = &quot;-t masterbox&quot;; SheepItPath = $defaultSheepItPath; Enabled = $true },
+ @{ ID = 5; Name = &quot;echo&quot;; SSHArgs = &quot;-t echo&quot;; SheepItPath = $defaultSheepItPath; Enabled = $true },
+ @{ ID = 6; Name = &quot;i9-13ks&quot;; SSHArgs = &quot;-t -p 22146 i9-13ks&quot;; SheepItPath = $defaultSheepItPath; Enabled = $true }
+ @{ ID = 1; Name = "i9kf"; SSHArgs = "-t i9kf"; SheepItPath = $defaultSheepItPath; Enabled = $false },
+ @{ ID = 2; Name = "blender-boss"; SSHArgs = "-t blender-boss"; SheepItPath = $defaultSheepItPath; Enabled = $true },
+ @{ ID = 3; Name = "max"; SSHArgs = "-t max"; SheepItPath = $defaultSheepItPath; Enabled = $true },
+ @{ ID = 4; Name = "masterbox"; SSHArgs = "-t masterbox"; SheepItPath = $defaultSheepItPath; Enabled = $true },
+ @{ ID = 5; Name = "echo"; SSHArgs = "-t echo"; SheepItPath = $defaultSheepItPath; Enabled = $true },
+ @{ ID = 6; Name = "i9-13ks"; SSHArgs = "-t -p 22146 i9-13ks"; SheepItPath = $defaultSheepItPath; Enabled = $true }
+)
+
+function Get-RemoteSheepItCommand {
+ param([string]$ExecutablePath)
+
+@&quot;
+&#96;$exe = &quot;$ExecutablePath&quot;
+@"
+&#96;$exe = "$ExecutablePath"
+if (-not (Test-Path &#96;$exe)) {
+ Write-Host &quot;SheepIt launcher not found at &#96;$exe&quot; -ForegroundColor Red
+ Write-Host "SheepIt launcher not found at &#96;$exe" -ForegroundColor Red
+ exit 1
+}
+
+&#96;$dir = Split-Path &#96;$exe
+Write-Host &quot;Launching SheepIt at &#96;$exe&quot; -ForegroundColor Cyan
+Write-Host "Launching SheepIt at &#96;$exe" -ForegroundColor Cyan
+&#96;$proc = Start-Process -FilePath &#96;$exe -WorkingDirectory &#96;$dir -WindowStyle Minimized -PassThru
+Write-Host &quot;SheepIt started (PID: &#96;$($proc.Id)).&quot; -ForegroundColor Green
+Write-Host "SheepIt started (PID: &#96;$($proc.Id))." -ForegroundColor Green
+exit 0
+&quot;@
+"@
+}
+
+function Start-SheepItWorker {
+ param([object]$Worker)
+
+ if (-not $Worker.Enabled) {
+ Write-Host &quot;$($Worker.Name) does not have SheepIt configured yet.&quot; -ForegroundColor Yellow
+ Write-Host "$($Worker.Name) does not have SheepIt configured yet." -ForegroundColor Yellow
+ return
+ }
+
+ $remoteCommand = Get-RemoteSheepItCommand -ExecutablePath $Worker.SheepItPath
+ $encoded = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($remoteCommand))
+ $ssh = &quot;ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=30 $($Worker.SSHArgs) \&quot;powershell -NoLogo -NoProfile -EncodedCommand $encoded\&quot;&quot;
+ $ssh = "ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=30 $($Worker.SSHArgs) \"powershell -NoLogo -NoProfile -EncodedCommand $encoded\""
+
+ Write-Host &quot;Connecting to $($Worker.Name)...&quot; -ForegroundColor Cyan
+ Write-Host "Connecting to $($Worker.Name)..." -ForegroundColor Cyan
+ try {
+ Invoke-Expression $ssh
+ $exitCode = $LASTEXITCODE
+
+ if ($exitCode -eq 0) {
+ Write-Host &quot;SheepIt launched on $($Worker.Name).&quot; -ForegroundColor Green
+ Write-Host "SheepIt launched on $($Worker.Name)." -ForegroundColor Green
+ } else {
+ Write-Host &quot;Launch on $($Worker.Name) exited with $exitCode.&quot; -ForegroundColor Red
+ Write-Host "Launch on $($Worker.Name) exited with $exitCode." -ForegroundColor Red
+ }
+ }
+ catch {
+ Write-Host &quot;Connection to $($Worker.Name) failed: $($_.Exception.Message)&quot; -ForegroundColor Red
+ Write-Host "Connection to $($Worker.Name) failed: $($_.Exception.Message)" -ForegroundColor Red
+ }
+}
+
@@ -115,7 +115,7 @@ Im wrapping up the main loop with clear menu options and proper input handlin
+ $targets = $workers | Where-Object { $_.Enabled }
+
+ if (-not $targets) {
+ Write-Host &quot;No systems are ready for SheepIt.&quot; -ForegroundColor Yellow
+ Write-Host "No systems are ready for SheepIt." -ForegroundColor Yellow
+ return
+ }
+
@@ -128,37 +128,37 @@ Im wrapping up the main loop with clear menu options and proper input handlin
+function Prompt-For-Worker {
+ while ($true) {
+ Show-Header
+ Write-Host &quot;Select a system:&quot; -ForegroundColor Magenta
+ Write-Host "Select a system:" -ForegroundColor Magenta
+
+ foreach ($worker in $workers) {
+ $status = if ($worker.Enabled) { &quot;ready&quot; } else { &quot;missing exe&quot; }
+ $color = if ($worker.Enabled) { &quot;Green&quot; } else { &quot;DarkYellow&quot; }
+ Write-Host (&quot;{0}. {1} ({2})&quot; -f $worker.ID, $worker.Name, $status) -ForegroundColor $color
+ $status = if ($worker.Enabled) { "ready" } else { "missing exe" }
+ $color = if ($worker.Enabled) { "Green" } else { "DarkYellow" }
+ Write-Host ("{0}. {1} ({2})" -f $worker.ID, $worker.Name, $status) -ForegroundColor $color
+ }
+
+ Write-Host &quot;B. Back&quot; -ForegroundColor Yellow
+ $selection = Read-Host &quot;Choose system&quot;
+ Write-Host "B. Back" -ForegroundColor Yellow
+ $selection = Read-Host "Choose system"
+
+ if ($selection -match &#39;^[Bb]$&#39;) {
+ if ($selection -match '^[Bb]$') {
+ return
+ }
+
+ if ($selection -match &#39;^\d+$&#39;) {
+ if ($selection -match '^\d+$') {
+ $id = [int]$selection
+ $worker = $workers | Where-Object { $_.ID -eq $id }
+
+ if ($worker) {
+ Start-SheepItWorker -Worker $worker
+ Write-Host
+ Read-Host &quot;Press Enter to return to the main menu&quot; | Out-Null
+ Read-Host "Press Enter to return to the main menu" | Out-Null
+ return
+ }
+
+ Write-Host &quot;Unknown selection.&quot; -ForegroundColor Red
+ Write-Host "Unknown selection." -ForegroundColor Red
+ Start-Sleep -Seconds 1
+ }
+ else {
+ Write-Host &quot;Invalid input.&quot; -ForegroundColor Red
+ Write-Host "Invalid input." -ForegroundColor Red
+ Start-Sleep -Seconds 1
+ }
+ }
@@ -166,29 +166,29 @@ Im wrapping up the main loop with clear menu options and proper input handlin
+
+while ($true) {
+ Show-Header
+ Write-Host &quot;Main Menu:&quot; -ForegroundColor Magenta
+ Write-Host &quot;1. Launch SheepIt on a single system&quot; -ForegroundColor Yellow
+ Write-Host &quot;2. Launch SheepIt on all ready systems&quot; -ForegroundColor Yellow
+ Write-Host &quot;3. Exit&quot; -ForegroundColor Yellow
+ Write-Host "Main Menu:" -ForegroundColor Magenta
+ Write-Host "1. Launch SheepIt on a single system" -ForegroundColor Yellow
+ Write-Host "2. Launch SheepIt on all ready systems" -ForegroundColor Yellow
+ Write-Host "3. Exit" -ForegroundColor Yellow
+
+ $choice = Read-Host &quot;Select option (1-3)&quot;
+ $choice = Read-Host "Select option (1-3)"
+
+ switch ($choice) {
+ &#39;1&#39; { Prompt-For-Worker }
+ &#39;2&#39; {
+ '1' { Prompt-For-Worker }
+ '2' {
+ Start-AllSheepIt
+ Write-Host
+ Read-Host &quot;Press Enter to return to the main menu&quot; | Out-Null
+ Read-Host "Press Enter to return to the main menu" | Out-Null
+ }
+ &#39;3&#39; { break }
+ '3' { break }
+ default {
+ Write-Host &quot;Invalid selection.&quot; -ForegroundColor Red
+ Write-Host "Invalid selection." -ForegroundColor Red
+ Start-Sleep -Seconds 1
+ }
+ }
+}
+
+Write-Host &quot;&#96;nExiting SheepIt launcher.&quot; -ForegroundColor Cyan
+Write-Host "&#96;nExiting SheepIt launcher." -ForegroundColor Cyan
*** End Patch
```
@@ -333,14 +333,14 @@ _**Agent (model gpt-5-codex, mode Agent)**_
*** Begin Patch
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
- $ssh = &quot;ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=30 $($Worker.SSHArgs) \&quot;powershell -NoLogo -NoProfile -EncodedCommand $encoded\&quot;&quot;
+ $ssh = &quot;ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=30 $($Worker.SSHArgs) &#96;&quot;powershell -NoLogo -NoProfile -EncodedCommand $encoded&#96;&quot;&quot;
- $ssh = "ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=30 $($Worker.SSHArgs) \"powershell -NoLogo -NoProfile -EncodedCommand $encoded\""
+ $ssh = "ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=30 $($Worker.SSHArgs) &#96;"powershell -NoLogo -NoProfile -EncodedCommand $encoded&#96;""
@@
-function Prompt-For-Worker {
+function Select-SheepItWorker {
@@
- &#39;1&#39; { Prompt-For-Worker }
+ &#39;1&#39; { Select-SheepItWorker }
- '1' { Prompt-For-Worker }
+ '1' { Select-SheepItWorker }
*** End Patch
```
@@ -435,7 +435,7 @@ _**Agent (model gpt-5-codex, mode Agent)**_
+@echo off
+title Unified SheepIt Launcher
+echo Starting Unified SheepIt Launcher...
+powershell -ExecutionPolicy Bypass -File &quot;%~dp0unified_sheepit_launcher.ps1&quot;
+powershell -ExecutionPolicy Bypass -File "%~dp0unified_sheepit_launcher.ps1"
*** End Patch
```
@@ -565,12 +565,12 @@ _**Agent (model gpt-5-codex, mode Agent)**_
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
-&#96;$proc = Start-Process -FilePath &#96;$exe -WorkingDirectory &#96;$dir -WindowStyle Minimized -PassThru
-Write-Host &quot;SheepIt started (PID: &#96;$($proc.Id)).&quot; -ForegroundColor Green
-Write-Host "SheepIt started (PID: &#96;$($proc.Id))." -ForegroundColor Green
+&#96;$proc = Start-Process -FilePath &#96;$exe -WorkingDirectory &#96;$dir -WindowStyle Minimized -PassThru
+if (&#96;$proc) {
+ Write-Host (&quot;SheepIt started (PID: {0}).&quot; -f &#96;$proc.Id) -ForegroundColor Green
+ Write-Host ("SheepIt started (PID: {0})." -f &#96;$proc.Id) -ForegroundColor Green
+} else {
+ Write-Host &quot;SheepIt start confirmed.&quot; -ForegroundColor Green
+ Write-Host "SheepIt start confirmed." -ForegroundColor Green
+}
*** End Patch
```
@@ -680,21 +680,21 @@ I'm going to update the remote script to pause briefly and then check if the sta
@@
-&#96;$proc = Start-Process -FilePath &#96;$exe -WorkingDirectory &#96;$dir -WindowStyle Minimized -PassThru
-if (&#96;$proc) {
- Write-Host (&quot;SheepIt started (PID: {0}).&quot; -f &#96;$proc.Id) -ForegroundColor Green
- Write-Host ("SheepIt started (PID: {0})." -f &#96;$proc.Id) -ForegroundColor Green
-} else {
- Write-Host &quot;SheepIt start confirmed.&quot; -ForegroundColor Green
- Write-Host "SheepIt start confirmed." -ForegroundColor Green
-}
+&#96;$proc = Start-Process -FilePath &#96;$exe -WorkingDirectory &#96;$dir -WindowStyle Minimized -PassThru
+if (&#96;$proc) {
+ Write-Host (&quot;SheepIt started (PID: {0}).&quot; -f &#96;$proc.Id) -ForegroundColor Green
+ Write-Host ("SheepIt started (PID: {0})." -f &#96;$proc.Id) -ForegroundColor Green
+ Start-Sleep -Seconds 1
+ if (Get-Process -Id &#96;$proc.Id -ErrorAction SilentlyContinue) {
+ Write-Host (&quot;SheepIt is running on &#96;$env:COMPUTERNAME (PID: {0}).&quot; -f &#96;$proc.Id) -ForegroundColor Green
+ Write-Host ("SheepIt is running on &#96;$env:COMPUTERNAME (PID: {0})." -f &#96;$proc.Id) -ForegroundColor Green
+ } else {
+ Write-Host &quot;SheepIt process exited immediately after launch.&quot; -ForegroundColor Yellow
+ Write-Host "SheepIt process exited immediately after launch." -ForegroundColor Yellow
+ }
+} else {
+ Write-Host &quot;SheepIt start confirmed.&quot; -ForegroundColor Green
+ Write-Host "SheepIt start confirmed." -ForegroundColor Green
+}
*** End Patch
```
@@ -775,45 +775,45 @@ This is a pretty detailed puzzle! Im outlining an approach to enhance the rem
@@
-&#96;$proc = Start-Process -FilePath &#96;$exe -WorkingDirectory &#96;$dir -WindowStyle Minimized -PassThru
-if (&#96;$proc) {
- Write-Host (&quot;SheepIt started (PID: {0}).&quot; -f &#96;$proc.Id) -ForegroundColor Green
- Write-Host ("SheepIt started (PID: {0})." -f &#96;$proc.Id) -ForegroundColor Green
- Start-Sleep -Seconds 1
- if (Get-Process -Id &#96;$proc.Id -ErrorAction SilentlyContinue) {
- Write-Host (&quot;SheepIt is running on &#96;$env:COMPUTERNAME (PID: {0}).&quot; -f &#96;$proc.Id) -ForegroundColor Green
- Write-Host ("SheepIt is running on &#96;$env:COMPUTERNAME (PID: {0})." -f &#96;$proc.Id) -ForegroundColor Green
- } else {
- Write-Host &quot;SheepIt process exited immediately after launch.&quot; -ForegroundColor Yellow
- Write-Host "SheepIt process exited immediately after launch." -ForegroundColor Yellow
- }
-} else {
- Write-Host &quot;SheepIt start confirmed.&quot; -ForegroundColor Green
- Write-Host "SheepIt start confirmed." -ForegroundColor Green
-}
+&#96;$proc = Start-Process -FilePath &#96;$exe -WorkingDirectory &#96;$dir -WindowStyle Minimized -PassThru
+if (&#96;$proc) {
+ &#96;$id = &#96;$proc.Id
+ Write-Host (&quot;SheepIt launcher started (PID: {0}).&quot; -f &#96;$id) -ForegroundColor Green
+ Write-Host ("SheepIt launcher started (PID: {0})." -f &#96;$id) -ForegroundColor Green
+ Start-Sleep -Seconds 1
+
+ if (Get-Process -Id &#96;$id -ErrorAction SilentlyContinue) {
+ Write-Host (&quot;SheepIt launcher is still running (PID: {0}).&quot; -f &#96;$id) -ForegroundColor Green
+ Write-Host ("SheepIt launcher is still running (PID: {0})." -f &#96;$id) -ForegroundColor Green
+ }
+ else {
+ try {
+ &#96;$children = Get-CimInstance Win32_Process -Filter &quot;ParentProcessId=&#96;$id&quot;
+ &#96;$children = Get-CimInstance Win32_Process -Filter "ParentProcessId=&#96;$id"
+ if (&#96;$children) {
+ Write-Host &quot;Launcher handed off to:&quot; -ForegroundColor Green
+ Write-Host "Launcher handed off to:" -ForegroundColor Green
+ foreach (&#96;$child in &#96;$children) {
+ Write-Host (&quot; {0} (PID: {1})&quot; -f &#96;$child.Name, &#96;$child.ProcessId) -ForegroundColor Green
+ Write-Host (" {0} (PID: {1})" -f &#96;$child.Name, &#96;$child.ProcessId) -ForegroundColor Green
+ }
+ }
+ else {
+ Write-Host &quot;Launcher exited immediately after starting. Check Task Manager for SheepIt/Java processes.&quot; -ForegroundColor Yellow
+ Write-Host "Launcher exited immediately after starting. Check Task Manager for SheepIt/Java processes." -ForegroundColor Yellow
+ }
+ }
+ catch {
+ Write-Host &quot;Unable to inspect child processes.&quot; -ForegroundColor Yellow
+ Write-Host "Unable to inspect child processes." -ForegroundColor Yellow
+ }
+ }
+}
+else {
+ Write-Host &quot;SheepIt start confirmed.&quot; -ForegroundColor Green
+ Write-Host "SheepIt start confirmed." -ForegroundColor Green
+}
*** End Patch
```
@@ -948,37 +948,37 @@ Parameters:
```json
{
&quot;plan&quot;: &quot;# SheepIt Jar Upgrade Plan\n\n1. Gather Render Key\n - Add session-level prompt storing the render key (secure string optional) so remote commands can inject &#96;--renderkey&#96;.\n\n2. Update Remote SheepIt Command\n - Replace executable launch with PowerShell that ensures &#96;%APPDATA%\\sheepit&#96; exists, downloads &#96;client-latest.jar&#96; to &#96;sheepit-client.jar&#96;, and runs &#96;java -jar&#96; with &#96;--ui text --stdout --verbose -gpu optix 0 --renderkey &lt;key&gt;&#96;.\n\n3. Make Launch Interactive\n - Adjust &#96;Start-SheepItWorker&#96; / &#96;Start-AllSheepIt&#96; to open each worker in its own terminal tab (like the Flamenco launcher) so the SSH session stays open after the jar exits, allowing CLI interaction.&quot;,
&quot;name&quot;: &quot;she&quot;,
&quot;todos&quot;: [
"plan": "# SheepIt Jar Upgrade Plan\n\n1. Gather Render Key\n - Add session-level prompt storing the render key (secure string optional) so remote commands can inject &#96;--renderkey&#96;.\n\n2. Update Remote SheepIt Command\n - Replace executable launch with PowerShell that ensures &#96;%APPDATA%\\sheepit&#96; exists, downloads &#96;client-latest.jar&#96; to &#96;sheepit-client.jar&#96;, and runs &#96;java -jar&#96; with &#96;--ui text --stdout --verbose -gpu optix 0 --renderkey &lt;key&gt;&#96;.\n\n3. Make Launch Interactive\n - Adjust &#96;Start-SheepItWorker&#96; / &#96;Start-AllSheepIt&#96; to open each worker in its own terminal tab (like the Flamenco launcher) so the SSH session stays open after the jar exits, allowing CLI interaction.",
"name": "she",
"todos": [
{
&quot;content&quot;: &quot;Add render key prompt/state to unified_sheepit_launcher.ps1&quot;,
&quot;status&quot;: &quot;pending&quot;,
&quot;id&quot;: &quot;renderkey-prompt&quot;
"content": "Add render key prompt/state to unified_sheepit_launcher.ps1",
"status": "pending",
"id": "renderkey-prompt"
},
{
&quot;content&quot;: &quot;Implement remote script to download jar to %APPDATA%\\sheepit and run java with requested flags&quot;,
&quot;status&quot;: &quot;pending&quot;,
&quot;id&quot;: &quot;remote-jar-command&quot;
"content": "Implement remote script to download jar to %APPDATA%\\sheepit and run java with requested flags",
"status": "pending",
"id": "remote-jar-command"
},
{
&quot;content&quot;: &quot;Update worker launch functions to run ssh in interactive tabs retaining session control&quot;,
&quot;status&quot;: &quot;pending&quot;,
&quot;id&quot;: &quot;interactive-launch&quot;
"content": "Update worker launch functions to run ssh in interactive tabs retaining session control",
"status": "pending",
"id": "interactive-launch"
}
],
&quot;overview&quot;: &quot;Switch SheepIt launcher to fetch the jar client per worker and run it interactively with render key support.&quot;
"overview": "Switch SheepIt launcher to fetch the jar client per worker and run it interactively with render key support."
}
```
Additional data:
```json
{
&quot;status&quot;: &quot;accepted&quot;,
&quot;reviewData&quot;: {
&quot;status&quot;: &quot;Requested&quot;,
&quot;selectedOption&quot;: &quot;none&quot;,
&quot;isShowingInput&quot;: false
"status": "accepted",
"reviewData": {
"status": "Requested",
"selectedOption": "none",
"isShowingInput": false
}
}
```
@@ -986,22 +986,22 @@ Result:
```json
{
&quot;accepted&quot;: {
&quot;finalTodos&quot;: [
"accepted": {
"finalTodos": [
{
&quot;content&quot;: &quot;Add render key prompt/state to unified_sheepit_launcher.ps1&quot;,
&quot;status&quot;: &quot;pending&quot;,
&quot;id&quot;: &quot;renderkey-prompt&quot;
"content": "Add render key prompt/state to unified_sheepit_launcher.ps1",
"status": "pending",
"id": "renderkey-prompt"
},
{
&quot;content&quot;: &quot;Implement remote script to download jar to %APPDATA%\\sheepit and run java with requested flags&quot;,
&quot;status&quot;: &quot;pending&quot;,
&quot;id&quot;: &quot;remote-jar-command&quot;
"content": "Implement remote script to download jar to %APPDATA%\\sheepit and run java with requested flags",
"status": "pending",
"id": "remote-jar-command"
},
{
&quot;content&quot;: &quot;Update worker launch functions to run ssh in interactive tabs retaining session control&quot;,
&quot;status&quot;: &quot;pending&quot;,
&quot;id&quot;: &quot;interactive-launch&quot;
"content": "Update worker launch functions to run ssh in interactive tabs retaining session control",
"status": "pending",
"id": "interactive-launch"
}
]
}
@@ -1089,37 +1089,37 @@ I'm planning how to generate per-worker session scripts that run SSH with the en
*** Begin Patch
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
-$defaultSheepItPath = &quot;C:\Users\Nathan\Desktop\sheepit-autoupdate.exe&quot;
-$defaultSheepItPath = "C:\Users\Nathan\Desktop\sheepit-autoupdate.exe"
-
-$workers = @(
- @{ ID = 1; Name = &quot;i9kf&quot;; SSHArgs = &quot;-t i9kf&quot;; SheepItPath = $defaultSheepItPath; Enabled = $false },
- @{ ID = 2; Name = &quot;blender-boss&quot;; SSHArgs = &quot;-t blender-boss&quot;; SheepItPath = $defaultSheepItPath; Enabled = $true },
- @{ ID = 3; Name = &quot;max&quot;; SSHArgs = &quot;-t max&quot;; SheepItPath = $defaultSheepItPath; Enabled = $true },
- @{ ID = 4; Name = &quot;masterbox&quot;; SSHArgs = &quot;-t masterbox&quot;; SheepItPath = $defaultSheepItPath; Enabled = $true },
- @{ ID = 5; Name = &quot;echo&quot;; SSHArgs = &quot;-t echo&quot;; SheepItPath = $defaultSheepItPath; Enabled = $true },
- @{ ID = 6; Name = &quot;i9-13ks&quot;; SSHArgs = &quot;-t -p 22146 i9-13ks&quot;; SheepItPath = $defaultSheepItPath; Enabled = $true }
- @{ ID = 1; Name = "i9kf"; SSHArgs = "-t i9kf"; SheepItPath = $defaultSheepItPath; Enabled = $false },
- @{ ID = 2; Name = "blender-boss"; SSHArgs = "-t blender-boss"; SheepItPath = $defaultSheepItPath; Enabled = $true },
- @{ ID = 3; Name = "max"; SSHArgs = "-t max"; SheepItPath = $defaultSheepItPath; Enabled = $true },
- @{ ID = 4; Name = "masterbox"; SSHArgs = "-t masterbox"; SheepItPath = $defaultSheepItPath; Enabled = $true },
- @{ ID = 5; Name = "echo"; SSHArgs = "-t echo"; SheepItPath = $defaultSheepItPath; Enabled = $true },
- @{ ID = 6; Name = "i9-13ks"; SSHArgs = "-t -p 22146 i9-13ks"; SheepItPath = $defaultSheepItPath; Enabled = $true }
-)
+$SheepItJarUrl = &#39;https://www.sheepit-renderfarm.com/media/applet/client-latest.jar&#39;
+$SheepItJarUrl = 'https://www.sheepit-renderfarm.com/media/applet/client-latest.jar'
+$script:SheepItUsername = $null
+$script:SheepItRenderKey = $null
+
+function Initialize-SheepItCredentials {
+ if (-not $script:SheepItUsername) {
+ $script:SheepItUsername = Read-Host &quot;SheepIt username&quot; -Default &quot;RaincloudTheDragon&quot;
+ $script:SheepItUsername = Read-Host "SheepIt username" -Default "RaincloudTheDragon"
+ }
+
+ if (-not $script:SheepItRenderKey) {
+ $script:SheepItRenderKey = Read-Host &quot;SheepIt render key&quot; -Default &quot;IfCOWBHFQpceG0601DmyrwOOJOAp2UJAQ0O0X0jF&quot;
+ $script:SheepItRenderKey = Read-Host "SheepIt render key" -Default "IfCOWBHFQpceG0601DmyrwOOJOAp2UJAQ0O0X0jF"
+ }
+}
+
+$workers = @(
+ @{ ID = 1; Name = &quot;i9kf&quot;; SSHArgs = &quot;-t i9kf&quot;; Enabled = $false },
+ @{ ID = 2; Name = &quot;blender-boss&quot;; SSHArgs = &quot;-t blender-boss&quot;; Enabled = $true },
+ @{ ID = 3; Name = &quot;max&quot;; SSHArgs = &quot;-t max&quot;; Enabled = $true },
+ @{ ID = 4; Name = &quot;masterbox&quot;; SSHArgs = &quot;-t masterbox&quot;; Enabled = $true },
+ @{ ID = 5; Name = &quot;echo&quot;; SSHArgs = &quot;-t echo&quot;; Enabled = $true },
+ @{ ID = 6; Name = &quot;i9-13ks&quot;; SSHArgs = &quot;-t -p 22146 i9-13ks&quot;; Enabled = $true }
+ @{ ID = 1; Name = "i9kf"; SSHArgs = "-t i9kf"; Enabled = $false },
+ @{ ID = 2; Name = "blender-boss"; SSHArgs = "-t blender-boss"; Enabled = $true },
+ @{ ID = 3; Name = "max"; SSHArgs = "-t max"; Enabled = $true },
+ @{ ID = 4; Name = "masterbox"; SSHArgs = "-t masterbox"; Enabled = $true },
+ @{ ID = 5; Name = "echo"; SSHArgs = "-t echo"; Enabled = $true },
+ @{ ID = 6; Name = "i9-13ks"; SSHArgs = "-t -p 22146 i9-13ks"; Enabled = $true }
+)
*** End Patch
```
@@ -1146,47 +1146,47 @@ I'm planning how to generate per-worker session scripts that run SSH with the en
-function Get-RemoteSheepItCommand {
- param([string]$ExecutablePath)
-
-@&quot;
-&#96;$exe = &quot;$ExecutablePath&quot;
-@"
-&#96;$exe = "$ExecutablePath"
-if (-not (Test-Path &#96;$exe)) {
- Write-Host &quot;SheepIt launcher not found at &#96;$exe&quot; -ForegroundColor Red
- Write-Host "SheepIt launcher not found at &#96;$exe" -ForegroundColor Red
- exit 1
-}
-
-&#96;$dir = Split-Path &#96;$exe
-Write-Host &quot;Launching SheepIt at &#96;$exe&quot; -ForegroundColor Cyan
-Write-Host "Launching SheepIt at &#96;$exe" -ForegroundColor Cyan
-&#96;$proc = Start-Process -FilePath &#96;$exe -WorkingDirectory &#96;$dir -WindowStyle Minimized -PassThru
-if (&#96;$proc) {
- &#96;$id = &#96;$proc.Id
- Write-Host (&quot;SheepIt launcher started (PID: {0}).&quot; -f &#96;$id) -ForegroundColor Green
- Write-Host ("SheepIt launcher started (PID: {0})." -f &#96;$id) -ForegroundColor Green
- Start-Sleep -Seconds 1
-
- if (Get-Process -Id &#96;$id -ErrorAction SilentlyContinue) {
- Write-Host (&quot;SheepIt launcher is still running (PID: {0}).&quot; -f &#96;$id) -ForegroundColor Green
- Write-Host ("SheepIt launcher is still running (PID: {0})." -f &#96;$id) -ForegroundColor Green
- }
- else {
- try {
- &#96;$children = Get-CimInstance Win32_Process -Filter &quot;ParentProcessId=&#96;$id&quot;
- &#96;$children = Get-CimInstance Win32_Process -Filter "ParentProcessId=&#96;$id"
- if (&#96;$children) {
- Write-Host &quot;Launcher handed off to:&quot; -ForegroundColor Green
- Write-Host "Launcher handed off to:" -ForegroundColor Green
- foreach (&#96;$child in &#96;$children) {
- Write-Host (&quot; {0} (PID: {1})&quot; -f &#96;$child.Name, &#96;$child.ProcessId) -ForegroundColor Green
- Write-Host (" {0} (PID: {1})" -f &#96;$child.Name, &#96;$child.ProcessId) -ForegroundColor Green
- }
- }
- else {
- Write-Host &quot;Launcher exited immediately after starting. Check Task Manager for SheepIt/Java processes.&quot; -ForegroundColor Yellow
- Write-Host "Launcher exited immediately after starting. Check Task Manager for SheepIt/Java processes." -ForegroundColor Yellow
- }
- }
- catch {
- Write-Host &quot;Unable to inspect child processes.&quot; -ForegroundColor Yellow
- Write-Host "Unable to inspect child processes." -ForegroundColor Yellow
- }
- }
-}
-else {
- Write-Host &quot;SheepIt start confirmed.&quot; -ForegroundColor Green
- Write-Host "SheepIt start confirmed." -ForegroundColor Green
-}
-exit 0
-&quot;@
-"@
-}
+function Get-RemoteSheepItCommand {
+ param(
@@ -1194,36 +1194,36 @@ I'm planning how to generate per-worker session scripts that run SSH with the en
+ [string]$Username
+ )
+
+ $safeKey = $RenderKey -replace &quot;&#39;&quot;, &quot;&#39;&#39;&quot;
+ $safeUser = $Username -replace &quot;&#39;&quot;, &quot;&#39;&#39;&quot;
+ $safeKey = $RenderKey -replace "'", "''"
+ $safeUser = $Username -replace "'", "''"
+
+@&quot;
+&#96;$ErrorActionPreference = &#39;Stop&#39;
+@"
+&#96;$ErrorActionPreference = 'Stop'
+
+try {
+ &#96;$appData = [Environment]::GetFolderPath(&#39;ApplicationData&#39;)
+ &#96;$sheepDir = Join-Path &#96;$appData &#39;sheepit&#39;
+ &#96;$appData = [Environment]::GetFolderPath('ApplicationData')
+ &#96;$sheepDir = Join-Path &#96;$appData 'sheepit'
+ if (-not (Test-Path &#96;$sheepDir)) {
+ New-Item -Path &#96;$sheepDir -ItemType Directory -Force | Out-Null
+ }
+
+ &#96;$jarPath = Join-Path &#96;$sheepDir &#39;sheepit-client.jar&#39;
+ Write-Host &quot;Downloading SheepIt client...&quot; -ForegroundColor Cyan
+ Invoke-WebRequest -Uri &#39;$SheepItJarUrl&#39; -OutFile &#96;$jarPath -UseBasicParsing
+ Write-Host &quot;Download complete.&quot; -ForegroundColor Green
+ &#96;$jarPath = Join-Path &#96;$sheepDir 'sheepit-client.jar'
+ Write-Host "Downloading SheepIt client..." -ForegroundColor Cyan
+ Invoke-WebRequest -Uri '$SheepItJarUrl' -OutFile &#96;$jarPath -UseBasicParsing
+ Write-Host "Download complete." -ForegroundColor Green
+
+ Write-Host &quot;Starting SheepIt client...&quot; -ForegroundColor Cyan
+ if (&#39;${safeUser}&#39;) {
+ Write-Host &quot;Authenticating as ${safeUser} via render key.&quot; -ForegroundColor Yellow
+ Write-Host "Starting SheepIt client..." -ForegroundColor Cyan
+ if ('${safeUser}') {
+ Write-Host "Authenticating as ${safeUser} via render key." -ForegroundColor Yellow
+ }
+
+ Set-Location &#96;$sheepDir
+ &amp; java -jar &#96;$jarPath --ui text --stdout --verbose -gpu optix 0 --renderkey &#39;${safeKey}&#39;
+ &amp; java -jar &#96;$jarPath --ui text --stdout --verbose -gpu optix 0 --renderkey '${safeKey}'
+}
+catch {
+ Write-Host &quot;Error: &#96;$($_.Exception.Message)&quot; -ForegroundColor Red
+ Write-Host "Error: &#96;$($_.Exception.Message)" -ForegroundColor Red
+}
+&quot;@
+"@
+}
*** End Patch
```
@@ -1269,32 +1269,32 @@ The model made no changes to the file.
*** Begin Patch
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
- $safeKey = $RenderKey -replace &quot;&#39;&quot;, &quot;&#39;&#39;&quot;
- $safeUser = $Username -replace &quot;&#39;&quot;, &quot;&#39;&#39;&quot;
- $safeKey = $RenderKey -replace "'", "''"
- $safeUser = $Username -replace "'", "''"
-
-@&quot;
+ $safeKey = $RenderKey -replace &quot;&#39;&quot;, &quot;&#39;&#39;&quot;
+ $safeUser = $Username -replace &quot;&#39;&quot;, &quot;&#39;&#39;&quot;
-@"
+ $safeKey = $RenderKey -replace "'", "''"
+ $safeUser = $Username -replace "'", "''"
+ $userLine = if ([string]::IsNullOrWhiteSpace($Username)) {
+ &#39;&#39;
+ ''
+ } else {
+ &quot; Write-Host &#39;Authenticating as ${safeUser} via render key.&#39; -ForegroundColor Yellow&#96;n&quot;
+ " Write-Host 'Authenticating as ${safeUser} via render key.' -ForegroundColor Yellow&#96;n"
+ }
+
+@&quot;
&#96;$ErrorActionPreference = &#39;Stop&#39;
+@"
&#96;$ErrorActionPreference = 'Stop'
try {
@@
- Write-Host &quot;Starting SheepIt client...&quot; -ForegroundColor Cyan
- if (&#39;${safeUser}&#39;) {
- Write-Host &quot;Authenticating as ${safeUser} via render key.&quot; -ForegroundColor Yellow
- Write-Host "Starting SheepIt client..." -ForegroundColor Cyan
- if ('${safeUser}') {
- Write-Host "Authenticating as ${safeUser} via render key." -ForegroundColor Yellow
- }
-
- Set-Location &#96;$sheepDir
+ Write-Host &quot;Starting SheepIt client...&quot; -ForegroundColor Cyan
+ Write-Host "Starting SheepIt client..." -ForegroundColor Cyan
+${userLine} Set-Location &#96;$sheepDir
&amp; java -jar &#96;$jarPath --ui text --stdout --verbose -gpu optix 0 --renderkey &#39;${safeKey}&#39;
&amp; java -jar &#96;$jarPath --ui text --stdout --verbose -gpu optix 0 --renderkey '${safeKey}'
}
catch {
*** End Patch
@@ -1323,27 +1323,27 @@ The model made no changes to the file.
- param([object]$Worker)
-
- if (-not $Worker.Enabled) {
- Write-Host &quot;$($Worker.Name) does not have SheepIt configured yet.&quot; -ForegroundColor Yellow
- Write-Host "$($Worker.Name) does not have SheepIt configured yet." -ForegroundColor Yellow
- return
- }
-
- $remoteCommand = Get-RemoteSheepItCommand -ExecutablePath $Worker.SheepItPath
- $encoded = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($remoteCommand))
- $ssh = &quot;ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=30 $($Worker.SSHArgs) &#96;&quot;powershell -NoLogo -NoProfile -EncodedCommand $encoded&#96;&quot;&quot;
- $ssh = "ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=30 $($Worker.SSHArgs) &#96;"powershell -NoLogo -NoProfile -EncodedCommand $encoded&#96;""
-
- Write-Host &quot;Connecting to $($Worker.Name)...&quot; -ForegroundColor Cyan
- Write-Host "Connecting to $($Worker.Name)..." -ForegroundColor Cyan
- try {
- Invoke-Expression $ssh
- $exitCode = $LASTEXITCODE
-
- if ($exitCode -eq 0) {
- Write-Host &quot;SheepIt launched on $($Worker.Name).&quot; -ForegroundColor Green
- Write-Host "SheepIt launched on $($Worker.Name)." -ForegroundColor Green
- } else {
- Write-Host &quot;Launch on $($Worker.Name) exited with $exitCode.&quot; -ForegroundColor Red
- Write-Host "Launch on $($Worker.Name) exited with $exitCode." -ForegroundColor Red
- }
- }
- catch {
- Write-Host &quot;Connection to $($Worker.Name) failed: $($_.Exception.Message)&quot; -ForegroundColor Red
- Write-Host "Connection to $($Worker.Name) failed: $($_.Exception.Message)" -ForegroundColor Red
- }
-}
+function New-SheepItSessionScript {
@@ -1352,12 +1352,12 @@ The model made no changes to the file.
+ [string]$EncodedCommand
+ )
+
+@&quot;
+Write-Host &#39;Connecting to $($Worker.Name)...&#39; -ForegroundColor Cyan
+ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=30 $($Worker.SSHArgs) &#96;&quot;powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -EncodedCommand $EncodedCommand&#96;&quot;
+Write-Host &quot;&#96;nSSH session ended.&quot; -ForegroundColor Yellow
+Read-Host &quot;Press Enter to close&quot;
+&quot;@
+@"
+Write-Host 'Connecting to $($Worker.Name)...' -ForegroundColor Cyan
+ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=30 $($Worker.SSHArgs) &#96;"powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -EncodedCommand $EncodedCommand&#96;"
+Write-Host "&#96;nSSH session ended." -ForegroundColor Yellow
+Read-Host "Press Enter to close"
+"@
+}
+
+function Launch-SheepItTab {
@@ -1366,13 +1366,13 @@ The model made no changes to the file.
+ [string]$Content
+ )
+
+ $tempScript = [System.IO.Path]::GetTempFileName() + &#39;.ps1&#39;
+ $tempScript = [System.IO.Path]::GetTempFileName() + '.ps1'
+ Set-Content -Path $tempScript -Value $Content -Encoding UTF8
+
+ if (Get-Command wt.exe -ErrorAction SilentlyContinue) {
+ Start-Process wt.exe -ArgumentList &quot;-w 0 new-tab --title &#96;&quot;$Title&#96;&quot; powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -File &#96;&quot;$tempScript&#96;&quot;&quot;
+ Start-Process wt.exe -ArgumentList "-w 0 new-tab --title &#96;"$Title&#96;" powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -File &#96;"$tempScript&#96;""
+ } else {
+ Start-Process powershell -ArgumentList &quot;-NoLogo -NoProfile -ExecutionPolicy Bypass -File &#96;&quot;$tempScript&#96;&quot;&quot;
+ Start-Process powershell -ArgumentList "-NoLogo -NoProfile -ExecutionPolicy Bypass -File &#96;"$tempScript&#96;""
+ }
+}
+
@@ -1380,7 +1380,7 @@ The model made no changes to the file.
+ param([object]$Worker)
+
+ if (-not $Worker.Enabled) {
+ Write-Host &quot;$($Worker.Name) is not enabled for SheepIt.&quot; -ForegroundColor Yellow
+ Write-Host "$($Worker.Name) is not enabled for SheepIt." -ForegroundColor Yellow
+ return
+ }
+
@@ -1389,10 +1389,10 @@ The model made no changes to the file.
+ $remoteCommand = Get-RemoteSheepItCommand -RenderKey $script:SheepItRenderKey -Username $script:SheepItUsername
+ $encoded = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($remoteCommand))
+ $sessionScript = New-SheepItSessionScript -Worker $Worker -EncodedCommand $encoded
+ $title = &quot;$($Worker.Name) - SheepIt&quot;
+ $title = "$($Worker.Name) - SheepIt"
+
+ Launch-SheepItTab -Title $title -Content $sessionScript
+ Write-Host &quot;Opened SheepIt session for $($Worker.Name) in a new terminal tab.&quot; -ForegroundColor Green
+ Write-Host "Opened SheepIt session for $($Worker.Name) in a new terminal tab." -ForegroundColor Green
+}
*** End Patch
```
@@ -1417,12 +1417,12 @@ The model made no changes to the file.
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
- foreach ($worker in $workers) {
- $status = if ($worker.Enabled) { &quot;ready&quot; } else { &quot;missing exe&quot; }
- $color = if ($worker.Enabled) { &quot;Green&quot; } else { &quot;DarkYellow&quot; }
- $status = if ($worker.Enabled) { "ready" } else { "missing exe" }
- $color = if ($worker.Enabled) { "Green" } else { "DarkYellow" }
+ foreach ($worker in $workers) {
+ $status = if ($worker.Enabled) { &quot;ready&quot; } else { &quot;disabled&quot; }
+ $color = if ($worker.Enabled) { &quot;Green&quot; } else { &quot;DarkYellow&quot; }
Write-Host (&quot;{0}. {1} ({2})&quot; -f $worker.ID, $worker.Name, $status) -ForegroundColor $color
+ $status = if ($worker.Enabled) { "ready" } else { "disabled" }
+ $color = if ($worker.Enabled) { "Green" } else { "DarkYellow" }
Write-Host ("{0}. {1} ({2})" -f $worker.ID, $worker.Name, $status) -ForegroundColor $color
}
*** End Patch
```
@@ -1560,14 +1560,14 @@ Lint errors for `unified_sheepit_launcher.ps1`
+function Start-SheepItTab {
@@
- if (Get-Command wt.exe -ErrorAction SilentlyContinue) {
- Start-Process wt.exe -ArgumentList &quot;-w 0 new-tab --title &#96;&quot;$Title&#96;&quot; powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -File &#96;&quot;$tempScript&#96;&quot;&quot;
- Start-Process wt.exe -ArgumentList "-w 0 new-tab --title &#96;"$Title&#96;" powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -File &#96;"$tempScript&#96;""
- } else {
- Start-Process powershell -ArgumentList &quot;-NoLogo -NoProfile -ExecutionPolicy Bypass -File &#96;&quot;$tempScript&#96;&quot;&quot;
- Start-Process powershell -ArgumentList "-NoLogo -NoProfile -ExecutionPolicy Bypass -File &#96;"$tempScript&#96;""
- }
+ if (Get-Command wt.exe -ErrorAction SilentlyContinue) {
+ Start-Process wt.exe -ArgumentList &quot;-w 0 new-tab --title &#96;&quot;$Title&#96;&quot; powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -File &#96;&quot;$tempScript&#96;&quot;&quot;
+ Start-Process wt.exe -ArgumentList "-w 0 new-tab --title &#96;"$Title&#96;" powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -File &#96;"$tempScript&#96;""
+ } else {
+ Start-Process powershell -ArgumentList &quot;-NoLogo -NoProfile -ExecutionPolicy Bypass -File &#96;&quot;$tempScript&#96;&quot;&quot;
+ Start-Process powershell -ArgumentList "-NoLogo -NoProfile -ExecutionPolicy Bypass -File &#96;"$tempScript&#96;""
+ }
}
@@
@@ -1723,9 +1723,9 @@ _**Agent (model gpt-5-codex, mode Agent)**_
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
-$workers = @(
- @{ ID = 1; Name = &quot;i9kf&quot;; SSHArgs = &quot;-t i9kf&quot;; Enabled = $false },
- @{ ID = 1; Name = "i9kf"; SSHArgs = "-t i9kf"; Enabled = $false },
+$workers = @(
+ @{ ID = 1; Name = &quot;i9kf&quot;; SSHArgs = &quot;-t i9kf&quot;; Enabled = $true },
+ @{ ID = 1; Name = "i9kf"; SSHArgs = "-t i9kf"; Enabled = $true },
*** End Patch
```
@@ -1798,13 +1798,13 @@ _**Agent (model gpt-5-codex, mode Agent)**_
@@
function Initialize-SheepItCredentials {
if (-not $script:SheepItUsername) {
- $script:SheepItUsername = Read-Host &quot;SheepIt username&quot; -Default &quot;RaincloudTheDragon&quot;
+ $script:SheepItUsername = &quot;RaincloudTheDragon&quot;
- $script:SheepItUsername = Read-Host "SheepIt username" -Default "RaincloudTheDragon"
+ $script:SheepItUsername = "RaincloudTheDragon"
}
if (-not $script:SheepItRenderKey) {
- $script:SheepItRenderKey = Read-Host &quot;SheepIt render key&quot; -Default &quot;IfCOWBHFQpceG0601DmyrwOOJOAp2UJAQ0O0X0jF&quot;
+ $script:SheepItRenderKey = &quot;IfCOWBHFQpceG0601DmyrwOOJOAp2UJAQ0O0X0jF&quot;
- $script:SheepItRenderKey = Read-Host "SheepIt render key" -Default "IfCOWBHFQpceG0601DmyrwOOJOAp2UJAQ0O0X0jF"
+ $script:SheepItRenderKey = "IfCOWBHFQpceG0601DmyrwOOJOAp2UJAQ0O0X0jF"
}
}
*** End Patch
@@ -1890,14 +1890,14 @@ _**Agent (model gpt-5-codex, mode Agent)**_
*** Begin Patch
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
- &amp; java -jar &#96;$jarPath --ui text --stdout --verbose -gpu optix 0 --renderkey &#39;${safeKey}&#39;
+ &amp; java -jar &#96;$jarPath --ui text --stdout --verbose -gpu optix 0 --renderkey &#39;${safeKey}&#39;
- &amp; java -jar &#96;$jarPath --ui text --stdout --verbose -gpu optix 0 --renderkey '${safeKey}'
+ &amp; java -jar &#96;$jarPath --ui text --stdout --verbose -gpu optix 0 --renderkey '${safeKey}'
}
catch {
- Write-Host &quot;Error: &#96;$($_.Exception.Message)&quot; -ForegroundColor Red
+ Write-Host (&#39;Error: {0}&#39; -f &#96;$_.Exception.Message) -ForegroundColor Red
- Write-Host "Error: &#96;$($_.Exception.Message)" -ForegroundColor Red
+ Write-Host ('Error: {0}' -f &#96;$_.Exception.Message) -ForegroundColor Red
}
&quot;@
"@
}
*** End Patch
```
@@ -1975,53 +1975,53 @@ _**Agent (model gpt-5-codex, mode Agent)**_
*** Begin Patch
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
-$SheepItJarUrl = &#39;https://www.sheepit-renderfarm.com/media/applet/client-latest.jar&#39;
-$SheepItJarUrl = 'https://www.sheepit-renderfarm.com/media/applet/client-latest.jar'
+$SheepItJarUrls = @(
+ &#39;https://www.sheepit-renderfarm.com/media/applet/client-latest.php&#39;,
+ &#39;https://www.sheepit-renderfarm.com/media/applet/client-latest.jar&#39;
+ 'https://www.sheepit-renderfarm.com/media/applet/client-latest.php',
+ 'https://www.sheepit-renderfarm.com/media/applet/client-latest.jar'
+)
@@
- $safeKey = $RenderKey -replace &quot;&#39;&quot;, &quot;&#39;&#39;&quot;
- $safeUser = $Username -replace &quot;&#39;&quot;, &quot;&#39;&#39;&quot;
+ $safeKey = $RenderKey -replace &quot;&#39;&quot;, &quot;&#39;&#39;&quot;
+ $safeUser = $Username -replace &quot;&#39;&quot;, &quot;&#39;&#39;&quot;
- $safeKey = $RenderKey -replace "'", "''"
- $safeUser = $Username -replace "'", "''"
+ $safeKey = $RenderKey -replace "'", "''"
+ $safeUser = $Username -replace "'", "''"
$userLine = if ([string]::IsNullOrWhiteSpace($Username)) {
&#39;&#39;
''
} else {
&quot; Write-Host &#39;Authenticating as ${safeUser} via render key.&#39; -ForegroundColor Yellow&#96;n&quot;
" Write-Host 'Authenticating as ${safeUser} via render key.' -ForegroundColor Yellow&#96;n"
}
+
+ $urlLiteral = &#39;@(&#39; + (($SheepItJarUrls | ForEach-Object { &quot;&#39;$_&#39;&quot; }) -join &#39;, &#39;) + &#39;)&#39;
+ $urlLiteral = '@(' + (($SheepItJarUrls | ForEach-Object { "'$_'" }) -join ', ') + ')'
@&quot;
&#96;$ErrorActionPreference = &#39;Stop&#39;
@"
&#96;$ErrorActionPreference = 'Stop'
try {
@@
- &#96;$jarPath = Join-Path &#96;$sheepDir &#39;sheepit-client.jar&#39;
- Write-Host &quot;Downloading SheepIt client...&quot; -ForegroundColor Cyan
- Invoke-WebRequest -Uri &#39;$SheepItJarUrl&#39; -OutFile &#96;$jarPath -UseBasicParsing
- Write-Host &quot;Download complete.&quot; -ForegroundColor Green
+ &#96;$jarPath = Join-Path &#96;$sheepDir &#39;sheepit-client.jar&#39;
- &#96;$jarPath = Join-Path &#96;$sheepDir 'sheepit-client.jar'
- Write-Host "Downloading SheepIt client..." -ForegroundColor Cyan
- Invoke-WebRequest -Uri '$SheepItJarUrl' -OutFile &#96;$jarPath -UseBasicParsing
- Write-Host "Download complete." -ForegroundColor Green
+ &#96;$jarPath = Join-Path &#96;$sheepDir 'sheepit-client.jar'
+ &#96;$urls = $urlLiteral
+ &#96;$headers = @{ &#39;User-Agent&#39; = &#39;Mozilla/5.0&#39; }
+ &#96;$headers = @{ 'User-Agent' = 'Mozilla/5.0' }
+ &#96;$downloaded = $false
+
+ foreach (&#96;$url in &#96;$urls) {
+ Write-Host &quot;Downloading SheepIt client from &#96;$url...&quot; -ForegroundColor Cyan
+ Write-Host "Downloading SheepIt client from &#96;$url..." -ForegroundColor Cyan
+ try {
+ Invoke-WebRequest -Uri &#96;$url -OutFile &#96;$jarPath -UseBasicParsing -Headers &#96;$headers
+ &#96;$downloaded = $true
+ Write-Host &quot;Download complete.&quot; -ForegroundColor Green
+ Write-Host "Download complete." -ForegroundColor Green
+ break
+ }
+ catch {
+ Write-Host (&quot;Download failed from {0}: {1}&quot; -f &#96;$url, &#96;$_.Exception.Message) -ForegroundColor Yellow
+ Write-Host ("Download failed from {0}: {1}" -f &#96;$url, &#96;$_.Exception.Message) -ForegroundColor Yellow
+ }
+ }
+
+ if (-not &#96;$downloaded) {
+ throw &#39;Unable to download SheepIt client from any known URL.&#39;
+ throw 'Unable to download SheepIt client from any known URL.'
+ }
*** End Patch
```
@@ -2134,9 +2134,9 @@ _**Agent (model gpt-5-codex, mode Agent)**_
*** Begin Patch
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
- &#96;$headers = @{ &#39;User-Agent&#39; = &#39;Mozilla/5.0&#39; }
- &#96;$headers = @{ 'User-Agent' = 'Mozilla/5.0' }
- &#96;$downloaded = $false
+ &#96;$headers = @{ &#39;User-Agent&#39; = &#39;Mozilla/5.0&#39; }
+ &#96;$headers = @{ 'User-Agent' = 'Mozilla/5.0' }
+ &#96;$downloaded = &#96;$false
@@
- &#96;$downloaded = $true
@@ -2458,57 +2458,57 @@ I'm updating the remote script to skip downloading the jar if it already exists,
*** Begin Patch
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
- &#96;$jarPath = Join-Path &#96;$sheepDir &#39;sheepit-client.jar&#39;
- &#96;$jarPath = Join-Path &#96;$sheepDir 'sheepit-client.jar'
- &#96;$urls = $urlLiteral
- &#96;$headers = @{ &#39;User-Agent&#39; = &#39;Mozilla/5.0&#39; }
- &#96;$headers = @{ 'User-Agent' = 'Mozilla/5.0' }
- &#96;$downloaded = &#96;$false
-
- foreach (&#96;$url in &#96;$urls) {
- Write-Host &quot;Downloading SheepIt client from &#96;$url...&quot; -ForegroundColor Cyan
- Write-Host "Downloading SheepIt client from &#96;$url..." -ForegroundColor Cyan
- try {
- Invoke-WebRequest -Uri &#96;$url -OutFile &#96;$jarPath -UseBasicParsing -Headers &#96;$headers
- &#96;$downloaded = &#96;$true
- Write-Host &quot;Download complete.&quot; -ForegroundColor Green
- Write-Host "Download complete." -ForegroundColor Green
- break
- }
- catch {
- Write-Host (&quot;Download failed from {0}: {1}&quot; -f &#96;$url, &#96;$_.Exception.Message) -ForegroundColor Yellow
- Write-Host ("Download failed from {0}: {1}" -f &#96;$url, &#96;$_.Exception.Message) -ForegroundColor Yellow
- }
- }
-
- if (-not &#96;$downloaded) {
- throw &#39;Unable to download SheepIt client from any known URL.&#39;
- throw 'Unable to download SheepIt client from any known URL.'
- }
+ &#96;$jarPath = Join-Path &#96;$sheepDir &#39;sheepit-client.jar&#39;
+ &#96;$jarPath = Join-Path &#96;$sheepDir 'sheepit-client.jar'
+ &#96;$urls = $urlLiteral
+ &#96;$headers = @{ &#39;User-Agent&#39; = &#39;Mozilla/5.0&#39; }
+ &#96;$headers = @{ 'User-Agent' = 'Mozilla/5.0' }
+
+ if (Test-Path &#96;$jarPath) {
+ Write-Host &quot;SheepIt client already present at &#96;$jarPath. Skipping download.&quot; -ForegroundColor Green
+ Write-Host "SheepIt client already present at &#96;$jarPath. Skipping download." -ForegroundColor Green
+ }
+ else {
+ &#96;$downloaded = &#96;$false
+
+ foreach (&#96;$url in &#96;$urls) {
+ Write-Host &quot;Downloading SheepIt client from &#96;$url...&quot; -ForegroundColor Cyan
+ Write-Host "Downloading SheepIt client from &#96;$url..." -ForegroundColor Cyan
+ try {
+ Invoke-WebRequest -Uri &#96;$url -OutFile &#96;$jarPath -UseBasicParsing -Headers &#96;$headers
+ &#96;$downloaded = &#96;$true
+ Write-Host &quot;Download complete.&quot; -ForegroundColor Green
+ Write-Host "Download complete." -ForegroundColor Green
+ break
+ }
+ catch {
+ Write-Host (&quot;Download failed from {0}: {1}&quot; -f &#96;$url, &#96;$_.Exception.Message) -ForegroundColor Yellow
+ Write-Host ("Download failed from {0}: {1}" -f &#96;$url, &#96;$_.Exception.Message) -ForegroundColor Yellow
+ }
+ }
+
+ if (-not &#96;$downloaded) {
+ throw &#39;Unable to download SheepIt client from any known URL.&#39;
+ throw 'Unable to download SheepIt client from any known URL.'
+ }
+ }
@@
- &amp; java -jar &#96;$jarPath --ui text --stdout --verbose -gpu optix 0 --renderkey &#39;${safeKey}&#39;
+ &amp; java -jar &#96;$jarPath -ui text --log-stdout --verbose -gpu OPTIX_0 --renderkey &#39;${safeKey}&#39;
- &amp; java -jar &#96;$jarPath --ui text --stdout --verbose -gpu optix 0 --renderkey '${safeKey}'
+ &amp; java -jar &#96;$jarPath -ui text --log-stdout --verbose -gpu OPTIX_0 --renderkey '${safeKey}'
}
catch {
*** End Patch
@@ -2784,8 +2784,8 @@ _**Agent (model gpt-5-codex, mode Agent)**_
*** Begin Patch
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
- &amp; java -jar &#96;$jarPath -ui text --log-stdout --verbose -gpu OPTIX_0 --renderkey &#39;${safeKey}&#39;
+ &amp; java -jar &#96;$jarPath -ui text --log-stdout --verbose -gpu OPTIX_0 -login &#39;${safeUser}&#39; -password &#39;${safeKey}&#39;
- &amp; java -jar &#96;$jarPath -ui text --log-stdout --verbose -gpu OPTIX_0 --renderkey '${safeKey}'
+ &amp; java -jar &#96;$jarPath -ui text --log-stdout --verbose -gpu OPTIX_0 -login '${safeUser}' -password '${safeKey}'
*** End Patch
```

View File

@@ -32,109 +32,109 @@ Im refining the plan to remove all daily path handling, carefully adjusting p
*** Update File: C:\Users\Nathan\Desktop\flamenco\scripts\TalkingHeads Custom Render.js
@@
{
key: &quot;render_output_root&quot;,
type: &quot;string&quot;,
subtype: &quot;dir_path&quot;,
key: "render_output_root",
type: "string",
subtype: "dir_path",
required: false,
visible: &quot;submission&quot;,
eval: &quot;__import__(&#39;os&#39;).path.normpath(__import__(&#39;os&#39;).path.join(((__import__(&#39;re&#39;).search(r&#39;^(.*?)[\\/][Bb]lends[\\/]&#39;, bpy.data.filepath.replace(&#39;\\\\&#39;,&#39;/&#39;)) and __import__(&#39;re&#39;).search(r&#39;^(.*?)[\\/][Bb]lends[\\/]&#39;, bpy.data.filepath.replace(&#39;\\\\&#39;,&#39;/&#39;)).group(1)) or __import__(&#39;os&#39;).path.dirname(bpy.data.filepath)), &#39;Renders&#39;))&quot;,
visible: "submission",
eval: "__import__('os').path.normpath(__import__('os').path.join(((__import__('re').search(r'^(.*?)[\\/][Bb]lends[\\/]', bpy.data.filepath.replace('\\\\','/')) and __import__('re').search(r'^(.*?)[\\/][Bb]lends[\\/]', bpy.data.filepath.replace('\\\\','/')).group(1)) or __import__('os').path.dirname(bpy.data.filepath)), 'Renders'))",
evalInfo: {
showLinkButton: true,
description: &quot;Auto-detect the project&#39;s Renders folder&quot;
description: "Auto-detect the project's Renders folder"
},
description: &quot;Base path where renders are stored, typically the project&#39;s Renders folder. If empty, derived automatically.&quot;
description: "Base path where renders are stored, typically the project's Renders folder. If empty, derived automatically."
},
- {
- key: &quot;daily_path&quot;,
- type: &quot;string&quot;,
- key: "daily_path",
- type: "string",
- required: false,
- visible: &quot;submission&quot;,
- eval: &quot;__import__(&#39;datetime&#39;).datetime.now().strftime(&#39;daily_%y%m%d&#39;)&quot;,
- visible: "submission",
- eval: "__import__('datetime').datetime.now().strftime('daily_%y%m%d')",
- evalInfo: {
- showLinkButton: true,
- description: &quot;Auto-fill with today&#39;s daily folder name&quot;
- description: "Auto-fill with today's daily folder name"
- },
- description: &quot;Daily folder name under the render root, e.g. &#39;daily_250813&#39;. If empty, auto-fills to today&#39;s date.&quot;
- description: "Daily folder name under the render root, e.g. 'daily_250813'. If empty, auto-fills to today's date."
- },
{
key: &quot;use_submodule&quot;,
label: &quot;Use Submodule&quot;,
type: &quot;bool&quot;,
key: "use_submodule",
label: "Use Submodule",
type: "bool",
required: false,
@@
{
key: &quot;render_output_path&quot;,
type: &quot;string&quot;,
subtype: &quot;file_path&quot;,
key: "render_output_path",
type: "string",
subtype: "file_path",
editable: false,
- eval: &quot;str(Path(abspath(settings.render_output_root or &#39;//&#39;), ((str(settings.submodule or &#39;&#39;).strip()) if (settings.use_submodule and str(settings.submodule or &#39;&#39;).strip()) else ((__import__(&#39;os&#39;).path.basename(__import__(&#39;os&#39;).path.dirname(bpy.data.filepath))) if settings.use_submodule else &#39;&#39;)), (settings.daily_path or __import__(&#39;datetime&#39;).datetime.now().strftime(&#39;daily_%y%m%d&#39;)), jobname, jobname + &#39;_######&#39;))&quot;,
+ eval: &quot;((lambda blendname: str(Path(abspath(settings.render_output_root or &#39;//&#39;), ((str(settings.submodule or &#39;&#39;).strip()) if (settings.use_submodule and str(settings.submodule or &#39;&#39;).strip()) else ((__import__(&#39;os&#39;).path.basename(__import__(&#39;os&#39;).path.dirname(bpy.data.filepath))) if settings.use_submodule else &#39;&#39;)), blendname, blendname + &#39;_######&#39;)))(__import__(&#39;os&#39;).path.splitext(__import__(&#39;os&#39;).path.basename(bpy.data.filepath))[0]))&quot;,
description: &quot;Final file path of where render output will be saved&quot;
- eval: "str(Path(abspath(settings.render_output_root or '//'), ((str(settings.submodule or '').strip()) if (settings.use_submodule and str(settings.submodule or '').strip()) else ((__import__('os').path.basename(__import__('os').path.dirname(bpy.data.filepath))) if settings.use_submodule else '')), (settings.daily_path or __import__('datetime').datetime.now().strftime('daily_%y%m%d')), jobname, jobname + '_######'))",
+ eval: "((lambda blendname: str(Path(abspath(settings.render_output_root or '//'), ((str(settings.submodule or '').strip()) if (settings.use_submodule and str(settings.submodule or '').strip()) else ((__import__('os').path.basename(__import__('os').path.dirname(bpy.data.filepath))) if settings.use_submodule else '')), blendname, blendname + '_######')))(__import__('os').path.splitext(__import__('os').path.basename(bpy.data.filepath))[0]))",
description: "Final file path of where render output will be saved"
},
@@
- if (!settings.daily_path || String(settings.daily_path).trim() === &#39;&#39;) {
- if (!settings.daily_path || String(settings.daily_path).trim() === '') {
- const createdDate = job &amp;&amp; job.created ? new Date(job.created) : new Date();
- settings.daily_path = formatDailyYYMMDD(createdDate);
- }
const recomposed = computeAutoRenderOutputPath(job);
if (recomposed) settings.render_output_path = recomposed;
@@
- const submodule = (settings.submodule &amp;&amp; (&quot;&quot; + settings.submodule).trim()) ? (&quot;&quot; + settings.submodule).trim() : detectSubmodule(settings);
- const submodule = (settings.submodule &amp;&amp; ("" + settings.submodule).trim()) ? ("" + settings.submodule).trim() : detectSubmodule(settings);
-
- // Resolve render root
- let renderRoot = null;
- if (settings.render_output_root &amp;&amp; (&quot;&quot; + settings.render_output_root).trim()) {
- renderRoot = (&quot;&quot; + settings.render_output_root).trim();
- if (settings.render_output_root &amp;&amp; ("" + settings.render_output_root).trim()) {
- renderRoot = ("" + settings.render_output_root).trim();
- } else if (projectRoot) {
- renderRoot = path.join(projectRoot, &#39;Renders&#39;);
- renderRoot = path.join(projectRoot, 'Renders');
- } else {
- // Fallback to the blendfile&#39;s directory Renders sibling
- renderRoot = path.join(path.dirname(settings.blendfile), &#39;Renders&#39;);
- // Fallback to the blendfile's directory Renders sibling
- renderRoot = path.join(path.dirname(settings.blendfile), 'Renders');
- }
-
- // Resolve daily path
- let daily = null;
- if (settings.daily_path &amp;&amp; (&quot;&quot; + settings.daily_path).trim()) {
- daily = (&quot;&quot; + settings.daily_path).trim();
- if (settings.daily_path &amp;&amp; ("" + settings.daily_path).trim()) {
- daily = ("" + settings.daily_path).trim();
- } else {
- const createdDate = job &amp;&amp; job.created ? new Date(job.created) : new Date();
- daily = formatDailyYYMMDD(createdDate);
- }
- const jobname = (job &amp;&amp; job.name) ? job.name : path.stem(settings.blendfile).replace(&#39;.flamenco&#39;, &#39;&#39;);
+ const submodule = (settings.submodule &amp;&amp; (&quot;&quot; + settings.submodule).trim()) ? (&quot;&quot; + settings.submodule).trim() : detectSubmodule(settings);
- const jobname = (job &amp;&amp; job.name) ? job.name : path.stem(settings.blendfile).replace('.flamenco', '');
+ const submodule = (settings.submodule &amp;&amp; ("" + settings.submodule).trim()) ? ("" + settings.submodule).trim() : detectSubmodule(settings);
+
+ // Resolve render root
+ let renderRoot = null;
+ if (settings.render_output_root &amp;&amp; (&quot;&quot; + settings.render_output_root).trim()) {
+ renderRoot = (&quot;&quot; + settings.render_output_root).trim();
+ if (settings.render_output_root &amp;&amp; ("" + settings.render_output_root).trim()) {
+ renderRoot = ("" + settings.render_output_root).trim();
+ } else if (projectRoot) {
+ renderRoot = path.join(projectRoot, &#39;Renders&#39;);
+ renderRoot = path.join(projectRoot, 'Renders');
+ } else {
+ // Fallback to the blendfile&#39;s directory Renders sibling
+ renderRoot = path.join(path.dirname(settings.blendfile), &#39;Renders&#39;);
+ // Fallback to the blendfile's directory Renders sibling
+ renderRoot = path.join(path.dirname(settings.blendfile), 'Renders');
+ }
+
+ const blendname = path.stem(settings.blendfile).replace(&#39;.flamenco&#39;, &#39;&#39;);
+ const blendname = path.stem(settings.blendfile).replace('.flamenco', '');
print(&#39;AutoPath: blendfile=&#39;, settings.blendfile);
print(&#39;AutoPath: projectRoot=&#39;, projectRoot);
print(&#39;AutoPath: renderRoot=&#39;, renderRoot);
print(&#39;AutoPath: submodule=&#39;, submodule);
- print(&#39;AutoPath: daily=&#39;, daily);
- print(&#39;AutoPath: jobname=&#39;, jobname);
+ print(&#39;AutoPath: blendname=&#39;, blendname);
print('AutoPath: blendfile=', settings.blendfile);
print('AutoPath: projectRoot=', projectRoot);
print('AutoPath: renderRoot=', renderRoot);
print('AutoPath: submodule=', submodule);
- print('AutoPath: daily=', daily);
- print('AutoPath: jobname=', jobname);
+ print('AutoPath: blendname=', blendname);
const parts = [renderRoot];
if (submodule) parts.push(submodule);
- parts.push(daily, jobname, &#96;${jobname}_######&#96;);
+ parts.push(blendname, &#96;${blendname}_######&#96;);
const finalPath = path.join.apply(path, parts);
print(&#39;AutoPath: finalPath=&#39;, finalPath);
print('AutoPath: finalPath=', finalPath);
return finalPath;
}
@@
-function formatDailyYYMMDD(dateObj) {
- const pad2 = (n) =&gt; (n &lt; 10 ? &#39;0&#39; + n : &#39;&#39; + n);
- const pad2 = (n) =&gt; (n &lt; 10 ? '0' + n : '' + n);
- const yy = (dateObj.getFullYear() % 100);
- const mm = dateObj.getMonth() + 1;
- const dd = dateObj.getDate();
@@ -164,45 +164,45 @@ Im refining the plan to remove all daily path handling, carefully adjusting p
*** Update File: C:\Users\Nathan\Desktop\flamenco\scripts\TalkingHeads cycles_optix_gpu.js
@@
{
key: &#39;render_output_root&#39;,
type: &#39;string&#39;,
subtype: &#39;dir_path&#39;,
key: 'render_output_root',
type: 'string',
subtype: 'dir_path',
required: false,
visible: &#39;submission&#39;,
visible: 'submission',
eval:
&quot;__import__(&#39;os&#39;).path.normpath(__import__(&#39;os&#39;).path.join(((__import__(&#39;re&#39;).search(r&#39;^(.*?)[\\/][Bb]lends[\\/]&#39;, bpy.data.filepath.replace(&#39;\\\\&#39;,&#39;/&#39;)) and __import__(&#39;re&#39;).search(r&#39;^(.*?)[\\/][Bb]lends[\\/]&#39;, bpy.data.filepath.replace(&#39;\\\\&#39;,&#39;/&#39;)).group(1)) or __import__(&#39;os&#39;).path.dirname(bpy.data.filepath)), &#39;Renders&#39;))&quot;,
evalInfo: { showLinkButton: true, description: &quot;Auto-detect the project&#39;s Renders folder&quot; },
"__import__('os').path.normpath(__import__('os').path.join(((__import__('re').search(r'^(.*?)[\\/][Bb]lends[\\/]', bpy.data.filepath.replace('\\\\','/')) and __import__('re').search(r'^(.*?)[\\/][Bb]lends[\\/]', bpy.data.filepath.replace('\\\\','/')).group(1)) or __import__('os').path.dirname(bpy.data.filepath)), 'Renders'))",
evalInfo: { showLinkButton: true, description: "Auto-detect the project's Renders folder" },
description:
&quot;Base path where renders are stored, typically the project&#39;s Renders folder. If empty, derived automatically.&quot;,
"Base path where renders are stored, typically the project's Renders folder. If empty, derived automatically.",
},
- {
- key: &#39;daily_path&#39;,
- type: &#39;string&#39;,
- key: 'daily_path',
- type: 'string',
- required: false,
- visible: &#39;submission&#39;,
- eval: &quot;__import__(&#39;datetime&#39;).datetime.now().strftime(&#39;daily_%y%m%d&#39;)&quot;,
- evalInfo: { showLinkButton: true, description: &quot;Auto-fill with today&#39;s daily folder name&quot; },
- visible: 'submission',
- eval: "__import__('datetime').datetime.now().strftime('daily_%y%m%d')",
- evalInfo: { showLinkButton: true, description: "Auto-fill with today's daily folder name" },
- description:
- &quot;Daily folder name under the render root, e.g. &#39;daily_250813&#39;. If empty, auto-fills to today&#39;s date.&quot;,
- "Daily folder name under the render root, e.g. 'daily_250813'. If empty, auto-fills to today's date.",
- },
{
key: &#39;use_submodule&#39;,
label: &#39;Use Submodule&#39;,
type: &#39;bool&#39;,
key: 'use_submodule',
label: 'Use Submodule',
type: 'bool',
required: false,
@@
{
key: &#39;render_output_path&#39;,
type: &#39;string&#39;,
subtype: &#39;file_path&#39;,
key: 'render_output_path',
type: 'string',
subtype: 'file_path',
editable: false,
- eval: &quot;str(Path(abspath(settings.render_output_root or &#39;//&#39;), ((str(settings.submodule or &#39;&#39;).strip()) if (settings.use_submodule and str(settings.submodule or &#39;&#39;).strip()) else ((__import__(&#39;os&#39;).path.basename(__import__(&#39;os&#39;).path.dirname(bpy.data.filepath))) if settings.use_submodule else &#39;&#39;)), (settings.daily_path or __import__(&#39;datetime&#39;).datetime.now().strftime(&#39;daily_%y%m%d&#39;)), jobname, jobname + &#39;_######&#39;))&quot;,
- eval: "str(Path(abspath(settings.render_output_root or '//'), ((str(settings.submodule or '').strip()) if (settings.use_submodule and str(settings.submodule or '').strip()) else ((__import__('os').path.basename(__import__('os').path.dirname(bpy.data.filepath))) if settings.use_submodule else '')), (settings.daily_path or __import__('datetime').datetime.now().strftime('daily_%y%m%d')), jobname, jobname + '_######'))",
+ eval:
+ &quot;((lambda blendname: str(Path(abspath(settings.render_output_root or &#39;//&#39;), ((str(settings.submodule or &#39;&#39;).strip()) if (settings.use_submodule and str(settings.submodule or &#39;&#39;).strip()) else ((__import__(&#39;os&#39;).path.basename(__import__(&#39;os&#39;).path.dirname(bpy.data.filepath))) if settings.use_submodule else &#39;&#39;)), blendname, blendname + &#39;_######&#39;)))(__import__(&#39;os&#39;).path.splitext(__import__(&#39;os&#39;).path.basename(bpy.data.filepath))[0]))&quot;,
description: &#39;Final file path of where render output will be saved&#39;,
+ "((lambda blendname: str(Path(abspath(settings.render_output_root or '//'), ((str(settings.submodule or '').strip()) if (settings.use_submodule and str(settings.submodule or '').strip()) else ((__import__('os').path.basename(__import__('os').path.dirname(bpy.data.filepath))) if settings.use_submodule else '')), blendname, blendname + '_######')))(__import__('os').path.splitext(__import__('os').path.basename(bpy.data.filepath))[0]))",
description: 'Final file path of where render output will be saved',
},
@@
- if (!settings.daily_path || String(settings.daily_path).trim() === &#39;&#39;) {
- if (!settings.daily_path || String(settings.daily_path).trim() === '') {
- const createdDate = job &amp;&amp; job.created ? new Date(job.created) : new Date();
- settings.daily_path = formatDailyYYMMDD(createdDate);
- }
@@ -212,22 +212,22 @@ Im refining the plan to remove all daily path handling, carefully adjusting p
- const submodule = detectSubmodule(settings);
- // Resolve render root
- let renderRoot = null;
- if (settings.render_output_root &amp;&amp; (&quot;&quot; + settings.render_output_root).trim()) {
- renderRoot = (&quot;&quot; + settings.render_output_root).trim();
- if (settings.render_output_root &amp;&amp; ("" + settings.render_output_root).trim()) {
- renderRoot = ("" + settings.render_output_root).trim();
- } else if (projectRoot) {
- renderRoot = path.join(projectRoot, &#39;Renders&#39;);
- renderRoot = path.join(projectRoot, 'Renders');
- } else {
- renderRoot = path.join(path.dirname(settings.blendfile), &#39;Renders&#39;);
- renderRoot = path.join(path.dirname(settings.blendfile), 'Renders');
- }
- // Resolve daily path
- let daily = null;
- if (settings.daily_path &amp;&amp; (&quot;&quot; + settings.daily_path).trim()) {
- daily = (&quot;&quot; + settings.daily_path).trim();
- if (settings.daily_path &amp;&amp; ("" + settings.daily_path).trim()) {
- daily = ("" + settings.daily_path).trim();
- } else {
- const createdDate = job &amp;&amp; job.created ? new Date(job.created) : new Date();
- daily = formatDailyYYMMDD(createdDate);
- }
- const jobname = job &amp;&amp; job.name ? job.name : path.stem(settings.blendfile).replace(&#39;.flamenco&#39;, &#39;&#39;);
- const jobname = job &amp;&amp; job.name ? job.name : path.stem(settings.blendfile).replace('.flamenco', '');
-
- const parts = [renderRoot];
- if (submodule) parts.push(submodule);
@@ -236,14 +236,14 @@ Im refining the plan to remove all daily path handling, carefully adjusting p
+ const submodule = detectSubmodule(settings);
+ // Resolve render root
+ let renderRoot = null;
+ if (settings.render_output_root &amp;&amp; (&quot;&quot; + settings.render_output_root).trim()) {
+ renderRoot = (&quot;&quot; + settings.render_output_root).trim();
+ if (settings.render_output_root &amp;&amp; ("" + settings.render_output_root).trim()) {
+ renderRoot = ("" + settings.render_output_root).trim();
+ } else if (projectRoot) {
+ renderRoot = path.join(projectRoot, &#39;Renders&#39;);
+ renderRoot = path.join(projectRoot, 'Renders');
+ } else {
+ renderRoot = path.join(path.dirname(settings.blendfile), &#39;Renders&#39;);
+ renderRoot = path.join(path.dirname(settings.blendfile), 'Renders');
+ }
+ const blendname = path.stem(settings.blendfile).replace(&#39;.flamenco&#39;, &#39;&#39;);
+ const blendname = path.stem(settings.blendfile).replace('.flamenco', '');
+
+ const parts = [renderRoot];
+ if (submodule) parts.push(submodule);
@@ -252,7 +252,7 @@ Im refining the plan to remove all daily path handling, carefully adjusting p
}
@@
-function formatDailyYYMMDD(dateObj) {
- const pad2 = (n) =&gt; (n &lt; 10 ? &#39;0&#39; + n : &#39;&#39; + n);
- const pad2 = (n) =&gt; (n &lt; 10 ? '0' + n : '' + n);
- const yy = dateObj.getFullYear() % 100;
- const mm = dateObj.getMonth() + 1;
- const dd = dateObj.getDate();
@@ -597,20 +597,20 @@ _**Agent (model gpt-5-codex, mode Agent)**_
*** Update File: C:\Users\Nathan\Desktop\flamenco\scripts\TalkingHeads Custom Render.js
@@
- {
- key: &quot;render_output_path&quot;,
- type: &quot;string&quot;,
- subtype: &quot;file_path&quot;,
- key: "render_output_path",
- type: "string",
- subtype: "file_path",
- editable: false,
- eval: &quot;((lambda blendname: str(Path(abspath(settings.render_output_root or &#39;//&#39;), ((str(settings.submodule or &#39;&#39;).strip()) if (settings.use_submodule and str(settings.submodule or &#39;&#39;).strip()) else ((__import__(&#39;os&#39;).path.basename(__import__(&#39;os&#39;).path.dirname(bpy.data.filepath))) if settings.use_submodule else &#39;&#39;)), blendname, blendname + &#39;_######&#39;)))(__import__(&#39;os&#39;).path.splitext(__import__(&#39;os&#39;).path.basename(bpy.data.filepath))[0]))&quot;,
- description: &quot;Final file path of where render output will be saved&quot;
- eval: "((lambda blendname: str(Path(abspath(settings.render_output_root or '//'), ((str(settings.submodule or '').strip()) if (settings.use_submodule and str(settings.submodule or '').strip()) else ((__import__('os').path.basename(__import__('os').path.dirname(bpy.data.filepath))) if settings.use_submodule else '')), blendname, blendname + '_######')))(__import__('os').path.splitext(__import__('os').path.basename(bpy.data.filepath))[0]))",
- description: "Final file path of where render output will be saved"
- },
+ {
+ key: &quot;render_output_path&quot;,
+ type: &quot;string&quot;,
+ subtype: &quot;file_path&quot;,
+ key: "render_output_path",
+ type: "string",
+ subtype: "file_path",
+ editable: false,
+ eval: &quot;((lambda Path, blend: str(Path(abspath(settings.render_output_root or &#39;//&#39;)) / (((str(settings.submodule or &#39;&#39;).strip()) if (settings.use_submodule and str(settings.submodule or &#39;&#39;).strip()) else ((__import__(&#39;os&#39;).path.basename(__import__(&#39;os&#39;).path.dirname(bpy.data.filepath))) if settings.use_submodule else &#39;&#39;))) / blend / (blend + &#39;_######&#39;)))(__import__(&#39;pathlib&#39;).Path, __import__(&#39;os&#39;).path.splitext(__import__(&#39;os&#39;).path.basename(bpy.data.filepath))[0]))&quot;,
+ description: &quot;Final file path of where render output will be saved&quot;
+ eval: "((lambda Path, blend: str(Path(abspath(settings.render_output_root or '//')) / (((str(settings.submodule or '').strip()) if (settings.use_submodule and str(settings.submodule or '').strip()) else ((__import__('os').path.basename(__import__('os').path.dirname(bpy.data.filepath))) if settings.use_submodule else ''))) / blend / (blend + '_######')))(__import__('pathlib').Path, __import__('os').path.splitext(__import__('os').path.basename(bpy.data.filepath))[0]))",
+ description: "Final file path of where render output will be saved"
+ },
*** End Patch
```
@@ -635,22 +635,22 @@ _**Agent (model gpt-5-codex, mode Agent)**_
*** Update File: C:\Users\Nathan\Desktop\flamenco\scripts\TalkingHeads cycles_optix_gpu.js
@@
- {
- key: &#39;render_output_path&#39;,
- type: &#39;string&#39;,
- subtype: &#39;file_path&#39;,
- key: 'render_output_path',
- type: 'string',
- subtype: 'file_path',
- editable: false,
- eval:
- &quot;((lambda blendname: str(Path(abspath(settings.render_output_root or &#39;//&#39;), ((str(settings.submodule or &#39;&#39;).strip()) if (settings.use_submodule and str(settings.submodule or &#39;&#39;).strip()) else ((__import__(&#39;os&#39;).path.basename(__import__(&#39;os&#39;).path.dirname(bpy.data.filepath))) if settings.use_submodule else &#39;&#39;)), blendname, blendname + &#39;_######&#39;)))(__import__(&#39;os&#39;).path.splitext(__import__(&#39;os&#39;).path.basename(bpy.data.filepath))[0]))&quot;,
- description: &#39;Final file path of where render output will be saved&#39;,
- "((lambda blendname: str(Path(abspath(settings.render_output_root or '//'), ((str(settings.submodule or '').strip()) if (settings.use_submodule and str(settings.submodule or '').strip()) else ((__import__('os').path.basename(__import__('os').path.dirname(bpy.data.filepath))) if settings.use_submodule else '')), blendname, blendname + '_######')))(__import__('os').path.splitext(__import__('os').path.basename(bpy.data.filepath))[0]))",
- description: 'Final file path of where render output will be saved',
- },
+ {
+ key: &#39;render_output_path&#39;,
+ type: &#39;string&#39;,
+ subtype: &#39;file_path&#39;,
+ key: 'render_output_path',
+ type: 'string',
+ subtype: 'file_path',
+ editable: false,
+ eval:
+ &quot;((lambda Path, blend: str(Path(abspath(settings.render_output_root or &#39;//&#39;)) / (((str(settings.submodule or &#39;&#39;).strip()) if (settings.use_submodule and str(settings.submodule or &#39;&#39;).strip()) else ((__import__(&#39;os&#39;).path.basename(__import__(&#39;os&#39;).path.dirname(bpy.data.filepath))) if settings.use_submodule else &#39;&#39;))) / blend / (blend + &#39;_######&#39;)))(__import__(&#39;pathlib&#39;).Path, __import__(&#39;os&#39;).path.splitext(__import__(&#39;os&#39;).path.basename(bpy.data.filepath))[0]))&quot;,
+ description: &#39;Final file path of where render output will be saved&#39;,
+ "((lambda Path, blend: str(Path(abspath(settings.render_output_root or '//')) / (((str(settings.submodule or '').strip()) if (settings.use_submodule and str(settings.submodule or '').strip()) else ((__import__('os').path.basename(__import__('os').path.dirname(bpy.data.filepath))) if settings.use_submodule else ''))) / blend / (blend + '_######')))(__import__('pathlib').Path, __import__('os').path.splitext(__import__('os').path.basename(bpy.data.filepath))[0]))",
+ description: 'Final file path of where render output will be saved',
+ },
*** End Patch
```
@@ -743,20 +743,20 @@ _**Agent (model gpt-5-codex, mode Agent)**_
*** Update File: C:\Users\Nathan\Desktop\flamenco\scripts\TalkingHeads Custom Render.js
@@
- {
- key: &quot;render_output_path&quot;,
- type: &quot;string&quot;,
- subtype: &quot;file_path&quot;,
- key: "render_output_path",
- type: "string",
- subtype: "file_path",
- editable: false,
- eval: &quot;((lambda Path, blend: str(Path(abspath(settings.render_output_root or &#39;//&#39;)) / (((str(settings.submodule or &#39;&#39;).strip()) if (settings.use_submodule and str(settings.submodule or &#39;&#39;).strip()) else ((__import__(&#39;os&#39;).path.basename(__import__(&#39;os&#39;).path.dirname(bpy.data.filepath))) if settings.use_submodule else &#39;&#39;))) / blend / (blend + &#39;_######&#39;)))(__import__(&#39;pathlib&#39;).Path, __import__(&#39;os&#39;).path.splitext(__import__(&#39;os&#39;).path.basename(bpy.data.filepath))[0]))&quot;,
- description: &quot;Final file path of where render output will be saved&quot;
- eval: "((lambda Path, blend: str(Path(abspath(settings.render_output_root or '//')) / (((str(settings.submodule or '').strip()) if (settings.use_submodule and str(settings.submodule or '').strip()) else ((__import__('os').path.basename(__import__('os').path.dirname(bpy.data.filepath))) if settings.use_submodule else ''))) / blend / (blend + '_######')))(__import__('pathlib').Path, __import__('os').path.splitext(__import__('os').path.basename(bpy.data.filepath))[0]))",
- description: "Final file path of where render output will be saved"
- },
+ {
+ key: &quot;render_output_path&quot;,
+ type: &quot;string&quot;,
+ subtype: &quot;file_path&quot;,
+ key: "render_output_path",
+ type: "string",
+ subtype: "file_path",
+ editable: false,
+ eval: &quot;((lambda Path, abspath, os_path, blend: str(Path(abspath(settings.render_output_root or &#39;//&#39;)) / (((str(settings.submodule or &#39;&#39;).strip()) if (settings.use_submodule and str(settings.submodule or &#39;&#39;).strip()) else ((os_path.basename(os_path.dirname(bpy.data.filepath))) if settings.use_submodule else &#39;&#39;))) / blend / (blend + &#39;_######&#39;)))(__import__(&#39;pathlib&#39;).Path, __import__(&#39;os&#39;).path.abspath, __import__(&#39;os&#39;).path, __import__(&#39;os&#39;).path.splitext(__import__(&#39;os&#39;).path.basename(bpy.data.filepath))[0]))&quot;,
+ description: &quot;Final file path of where render output will be saved&quot;
+ eval: "((lambda Path, abspath, os_path, blend: str(Path(abspath(settings.render_output_root or '//')) / (((str(settings.submodule or '').strip()) if (settings.use_submodule and str(settings.submodule or '').strip()) else ((os_path.basename(os_path.dirname(bpy.data.filepath))) if settings.use_submodule else ''))) / blend / (blend + '_######')))(__import__('pathlib').Path, __import__('os').path.abspath, __import__('os').path, __import__('os').path.splitext(__import__('os').path.basename(bpy.data.filepath))[0]))",
+ description: "Final file path of where render output will be saved"
+ },
*** End Patch
```
@@ -776,22 +776,22 @@ _**Agent (model gpt-5-codex, mode Agent)**_
*** Update File: C:\Users\Nathan\Desktop\flamenco\scripts\TalkingHeads cycles_optix_gpu.js
@@
- {
- key: &#39;render_output_path&#39;,
- type: &#39;string&#39;,
- subtype: &#39;file_path&#39;,
- key: 'render_output_path',
- type: 'string',
- subtype: 'file_path',
- editable: false,
- eval:
- &quot;((lambda Path, blend: str(Path(abspath(settings.render_output_root or &#39;//&#39;)) / (((str(settings.submodule or &#39;&#39;).strip()) if (settings.use_submodule and str(settings.submodule or &#39;&#39;).strip()) else ((__import__(&#39;os&#39;).path.basename(__import__(&#39;os&#39;).path.dirname(bpy.data.filepath))) if settings.use_submodule else &#39;&#39;))) / blend / (blend + &#39;_######&#39;)))(__import__(&#39;pathlib&#39;).Path, __import__(&#39;os&#39;).path.splitext(__import__(&#39;os&#39;).path.basename(bpy.data.filepath))[0]))&quot;,
- description: &#39;Final file path of where render output will be saved&#39;,
- "((lambda Path, blend: str(Path(abspath(settings.render_output_root or '//')) / (((str(settings.submodule or '').strip()) if (settings.use_submodule and str(settings.submodule or '').strip()) else ((__import__('os').path.basename(__import__('os').path.dirname(bpy.data.filepath))) if settings.use_submodule else ''))) / blend / (blend + '_######')))(__import__('pathlib').Path, __import__('os').path.splitext(__import__('os').path.basename(bpy.data.filepath))[0]))",
- description: 'Final file path of where render output will be saved',
- },
+ {
+ key: &#39;render_output_path&#39;,
+ type: &#39;string&#39;,
+ subtype: &#39;file_path&#39;,
+ key: 'render_output_path',
+ type: 'string',
+ subtype: 'file_path',
+ editable: false,
+ eval:
+ &quot;((lambda Path, abspath, os_path, blend: str(Path(abspath(settings.render_output_root or &#39;//&#39;)) / (((str(settings.submodule or &#39;&#39;).strip()) if (settings.use_submodule and str(settings.submodule or &#39;&#39;).strip()) else ((os_path.basename(os_path.dirname(bpy.data.filepath))) if settings.use_submodule else &#39;&#39;))) / blend / (blend + &#39;_######&#39;)))(__import__(&#39;pathlib&#39;).Path, __import__(&#39;os&#39;).path.abspath, __import__(&#39;os&#39;).path, __import__(&#39;os&#39;).path.splitext(__import__(&#39;os&#39;).path.basename(bpy.data.filepath))[0]))&quot;,
+ description: &#39;Final file path of where render output will be saved&#39;,
+ "((lambda Path, abspath, os_path, blend: str(Path(abspath(settings.render_output_root or '//')) / (((str(settings.submodule or '').strip()) if (settings.use_submodule and str(settings.submodule or '').strip()) else ((os_path.basename(os_path.dirname(bpy.data.filepath))) if settings.use_submodule else ''))) / blend / (blend + '_######')))(__import__('pathlib').Path, __import__('os').path.abspath, __import__('os').path, __import__('os').path.splitext(__import__('os').path.basename(bpy.data.filepath))[0]))",
+ description: 'Final file path of where render output will be saved',
+ },
*** End Patch
```
@@ -948,20 +948,20 @@ I'm figuring out why the new lambda-based eval code can't see the `settings` var
*** Update File: C:\Users\Nathan\Desktop\flamenco\scripts\TalkingHeads Custom Render.js
@@
- {
- key: &quot;render_output_path&quot;,
- type: &quot;string&quot;,
- subtype: &quot;file_path&quot;,
- key: "render_output_path",
- type: "string",
- subtype: "file_path",
- editable: false,
- eval: &quot;((lambda Path, abspath, os_path, blend: str(Path(abspath(settings.render_output_root or &#39;//&#39;)) / (((str(settings.submodule or &#39;&#39;).strip()) if (settings.use_submodule and str(settings.submodule or &#39;&#39;).strip()) else ((os_path.basename(os_path.dirname(bpy.data.filepath))) if settings.use_submodule else &#39;&#39;))) / blend / (blend + &#39;_######&#39;)))(__import__(&#39;pathlib&#39;).Path, __import__(&#39;os&#39;).path.abspath, __import__(&#39;os&#39;).path, __import__(&#39;os&#39;).path.splitext(__import__(&#39;os&#39;).path.basename(bpy.data.filepath))[0]))&quot;,
- description: &quot;Final file path of where render output will be saved&quot;
- eval: "((lambda Path, abspath, os_path, blend: str(Path(abspath(settings.render_output_root or '//')) / (((str(settings.submodule or '').strip()) if (settings.use_submodule and str(settings.submodule or '').strip()) else ((os_path.basename(os_path.dirname(bpy.data.filepath))) if settings.use_submodule else ''))) / blend / (blend + '_######')))(__import__('pathlib').Path, __import__('os').path.abspath, __import__('os').path, __import__('os').path.splitext(__import__('os').path.basename(bpy.data.filepath))[0]))",
- description: "Final file path of where render output will be saved"
- },
+ {
+ key: &quot;render_output_path&quot;,
+ type: &quot;string&quot;,
+ subtype: &quot;file_path&quot;,
+ key: "render_output_path",
+ type: "string",
+ subtype: "file_path",
+ editable: false,
+ eval: &quot;((lambda Path, abspath, os_path, settings_obj, blend: str(Path(abspath(settings_obj.render_output_root or &#39;//&#39;)) / (((str(settings_obj.submodule or &#39;&#39;).strip()) if (settings_obj.use_submodule and str(settings_obj.submodule or &#39;&#39;).strip()) else ((os_path.basename(os_path.dirname(bpy.data.filepath))) if settings_obj.use_submodule else &#39;&#39;))) / blend / (blend + &#39;_######&#39;)))(__import__(&#39;pathlib&#39;).Path, __import__(&#39;os&#39;).path.abspath, __import__(&#39;os&#39;).path, settings, __import__(&#39;os&#39;).path.splitext(__import__(&#39;os&#39;).path.basename(bpy.data.filepath))[0]))&quot;,
+ description: &quot;Final file path of where render output will be saved&quot;
+ eval: "((lambda Path, abspath, os_path, settings_obj, blend: str(Path(abspath(settings_obj.render_output_root or '//')) / (((str(settings_obj.submodule or '').strip()) if (settings_obj.use_submodule and str(settings_obj.submodule or '').strip()) else ((os_path.basename(os_path.dirname(bpy.data.filepath))) if settings_obj.use_submodule else ''))) / blend / (blend + '_######')))(__import__('pathlib').Path, __import__('os').path.abspath, __import__('os').path, settings, __import__('os').path.splitext(__import__('os').path.basename(bpy.data.filepath))[0]))",
+ description: "Final file path of where render output will be saved"
+ },
*** End Patch
```
@@ -981,22 +981,22 @@ I'm figuring out why the new lambda-based eval code can't see the `settings` var
*** Update File: C:\Users\Nathan\Desktop\flamenco\scripts\TalkingHeads cycles_optix_gpu.js
@@
- {
- key: &#39;render_output_path&#39;,
- type: &#39;string&#39;,
- subtype: &#39;file_path&#39;,
- key: 'render_output_path',
- type: 'string',
- subtype: 'file_path',
- editable: false,
- eval:
- &quot;((lambda Path, abspath, os_path, blend: str(Path(abspath(settings.render_output_root or &#39;//&#39;)) / (((str(settings.submodule or &#39;&#39;).strip()) if (settings.use_submodule and str(settings.submodule or &#39;&#39;).strip()) else ((os_path.basename(os_path.dirname(bpy.data.filepath))) if settings.use_submodule else &#39;&#39;))) / blend / (blend + &#39;_######&#39;)))(__import__(&#39;pathlib&#39;).Path, __import__(&#39;os&#39;).path.abspath, __import__(&#39;os&#39;).path, __import__(&#39;os&#39;).path.splitext(__import__(&#39;os&#39;).path.basename(bpy.data.filepath))[0]))&quot;,
- description: &#39;Final file path of where render output will be saved&#39;,
- "((lambda Path, abspath, os_path, blend: str(Path(abspath(settings.render_output_root or '//')) / (((str(settings.submodule or '').strip()) if (settings.use_submodule and str(settings.submodule or '').strip()) else ((os_path.basename(os_path.dirname(bpy.data.filepath))) if settings.use_submodule else ''))) / blend / (blend + '_######')))(__import__('pathlib').Path, __import__('os').path.abspath, __import__('os').path, __import__('os').path.splitext(__import__('os').path.basename(bpy.data.filepath))[0]))",
- description: 'Final file path of where render output will be saved',
- },
+ {
+ key: &#39;render_output_path&#39;,
+ type: &#39;string&#39;,
+ subtype: &#39;file_path&#39;,
+ key: 'render_output_path',
+ type: 'string',
+ subtype: 'file_path',
+ editable: false,
+ eval:
+ &quot;((lambda Path, abspath, os_path, settings_obj, blend: str(Path(abspath(settings_obj.render_output_root or &#39;//&#39;)) / (((str(settings_obj.submodule or &#39;&#39;).strip()) if (settings_obj.use_submodule and str(settings_obj.submodule or &#39;&#39;).strip()) else ((os_path.basename(os_path.dirname(bpy.data.filepath))) if settings_obj.use_submodule else &#39;&#39;))) / blend / (blend + &#39;_######&#39;)))(__import__(&#39;pathlib&#39;).Path, __import__(&#39;os&#39;).path.abspath, __import__(&#39;os&#39;).path, settings, __import__(&#39;os&#39;).path.splitext(__import__(&#39;os&#39;).path.basename(bpy.data.filepath))[0]))&quot;,
+ description: &#39;Final file path of where render output will be saved&#39;,
+ "((lambda Path, abspath, os_path, settings_obj, blend: str(Path(abspath(settings_obj.render_output_root or '//')) / (((str(settings_obj.submodule or '').strip()) if (settings_obj.use_submodule and str(settings_obj.submodule or '').strip()) else ((os_path.basename(os_path.dirname(bpy.data.filepath))) if settings_obj.use_submodule else ''))) / blend / (blend + '_######')))(__import__('pathlib').Path, __import__('os').path.abspath, __import__('os').path, settings, __import__('os').path.splitext(__import__('os').path.basename(bpy.data.filepath))[0]))",
+ description: 'Final file path of where render output will be saved',
+ },
*** End Patch
```

View File

@@ -66,7 +66,7 @@ The error "Failed setting boot class path" usually indicates a Java version mism
<tool-use data-tool-type="write" data-tool-name="search_replace">
<details><summary>Tool use: **code_edit** • Edit file: unified_sheepit_launcher.ps1</summary>
<details><summary>Tool use: **search_replace** • Edit file: unified_sheepit_launcher.ps1</summary>
**Chunk 1**
Lines added: 13, lines removed: 2
@@ -74,22 +74,22 @@ Lines added: 13, lines removed: 2
```diff
@@ -88,6 +88,17 @@
Write-Host &quot;Starting SheepIt client...&quot; -ForegroundColor Cyan
Write-Host "Starting SheepIt client..." -ForegroundColor Cyan
- ${userLine} Set-Location &#96;$sheepDir
- &amp; java -jar &#96;$jarPath -ui text --log-stdout --verbose -gpu OPTIX_0 -login &#39;${safeUser}&#39; -password &#39;${safeKey}&#39;
- &amp; java -jar &#96;$jarPath -ui text --log-stdout --verbose -gpu OPTIX_0 -login '${safeUser}' -password '${safeKey}'
+
+ # Check Java version
+ try {
+ &#96;$javaVersion = java -version 2&gt;&amp;1 | Select-Object -First 1
+ Write-Host &quot;Java version: &#96;$javaVersion&quot; -ForegroundColor Gray
+ Write-Host "Java version: &#96;$javaVersion" -ForegroundColor Gray
+ }
+ catch {
+ Write-Host &quot;Warning: Could not determine Java version&quot; -ForegroundColor Yellow
+ Write-Host "Warning: Could not determine Java version" -ForegroundColor Yellow
+ }
+
+ Set-Location &#96;$sheepDir
+ # Use -XX:+IgnoreUnrecognizedVMOptions to handle any incompatible JVM args
+ &amp; java -XX:+IgnoreUnrecognizedVMOptions -jar &#96;$jarPath -ui text --log-stdout --verbose -gpu OPTIX_0 -login &#39;${safeUser}&#39; -password &#39;${safeKey}&#39;
+ &amp; java -XX:+IgnoreUnrecognizedVMOptions -jar &#96;$jarPath -ui text --log-stdout --verbose -gpu OPTIX_0 -login '${safeUser}' -password '${safeKey}'
}
catch {
```
@@ -112,7 +112,7 @@ Improving error handling to capture and display more details about Java errors:
<tool-use data-tool-type="write" data-tool-name="search_replace">
<details><summary>Tool use: **code_edit** • Edit file: unified_sheepit_launcher.ps1</summary>
<details><summary>Tool use: **search_replace** • Edit file: unified_sheepit_launcher.ps1</summary>
**Chunk 1**
Lines added: 20, lines removed: 1
@@ -124,30 +124,30 @@ Lines added: 20, lines removed: 1
+
+ # Check for problematic environment variables
+ if (&#96;$env:JAVA_TOOL_OPTIONS) {
+ Write-Host &quot;Warning: JAVA_TOOL_OPTIONS is set: &#96;$env:JAVA_TOOL_OPTIONS&quot; -ForegroundColor Yellow
+ Write-Host "Warning: JAVA_TOOL_OPTIONS is set: &#96;$env:JAVA_TOOL_OPTIONS" -ForegroundColor Yellow
+ }
+
# Use -XX:+IgnoreUnrecognizedVMOptions to handle any incompatible JVM args
- &amp; java -XX:+IgnoreUnrecognizedVMOptions -jar &#96;$jarPath -ui text --log-stdout --verbose -gpu OPTIX_0 -login &#39;${safeUser}&#39; -password &#39;${safeKey}&#39;
- &amp; java -XX:+IgnoreUnrecognizedVMOptions -jar &#96;$jarPath -ui text --log-stdout --verbose -gpu OPTIX_0 -login '${safeUser}' -password '${safeKey}'
+ # This flag helps with Java 9+ compatibility issues
+ &#96;$javaArgs = @(&#39;-XX:+IgnoreUnrecognizedVMOptions&#39;, &#39;-jar&#39;, &#96;$jarPath,
+ &#39;-ui&#39;, &#39;text&#39;, &#39;--log-stdout&#39;, &#39;--verbose&#39;,
+ &#39;-gpu&#39;, &#39;OPTIX_0&#39;, &#39;-login&#39;, &#39;${safeUser}&#39;, &#39;-password&#39;, &#39;${safeKey}&#39;)
+ &#96;$javaArgs = @('-XX:+IgnoreUnrecognizedVMOptions', '-jar', &#96;$jarPath,
+ '-ui', 'text', '--log-stdout', '--verbose',
+ '-gpu', 'OPTIX_0', '-login', '${safeUser}', '-password', '${safeKey}')
+
+ try {
+ &amp; java @javaArgs
+ }
+ catch {
+ Write-Host (&#39;Java execution error: {0}&#39; -f &#96;$_.Exception.Message) -ForegroundColor Red
+ Write-Host &quot;If the error persists, try updating Java to a compatible version (Java 8 or Java 11+ recommended).&quot; -ForegroundColor Yellow
+ Write-Host ('Java execution error: {0}' -f &#96;$_.Exception.Message) -ForegroundColor Red
+ Write-Host "If the error persists, try updating Java to a compatible version (Java 8 or Java 11+ recommended)." -ForegroundColor Yellow
+ throw
+ }
}
catch {
Write-Host (&#39;Error: {0}&#39; -f &#96;$_.Exception.Message) -ForegroundColor Red
+ Write-Host (&#39;Stack trace: {0}&#39; -f &#96;$_.ScriptStackTrace) -ForegroundColor DarkRed
Write-Host ('Error: {0}' -f &#96;$_.Exception.Message) -ForegroundColor Red
+ Write-Host ('Stack trace: {0}' -f &#96;$_.ScriptStackTrace) -ForegroundColor DarkRed
}
&quot;@
"@
```
</details>
@@ -239,14 +239,14 @@ SSHing into i9-13ks to check internet connectivity and diagnose the Java issue.
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: ssh -t -p 22146 i9-13ks "powershell -Command \"Write-Host 'Testing internet connectivity...' -ForegroundColor Cyan; Test-NetConnection -ComputerName google.com -Port 80 -InformationLevel Quiet; if ($?) { Write-Host 'Internet connection: OK' -ForegroundColor Green } else { Write-Host 'Internet connection: FAILED' -ForegroundColor Red }; Write-Host ''; Write-Host 'Testing DNS resolution...' -ForegroundColor Cyan; try { $result = Resolve-DnsName -Name google.com -ErrorAction Stop; Write-Host 'DNS resolution: OK' -ForegroundColor Green } catch { Write-Host 'DNS resolution: FAILED' -ForegroundColor Red }; Write-Host ''; Write-Host 'Testing HTTP connectivity...' -ForegroundColor Cyan; try { $response = Invoke-WebRequest -Uri 'https://www.google.com' -TimeoutSec 5 -UseBasicParsing -ErrorAction Stop; Write-Host 'HTTP connectivity: OK' -ForegroundColor Green } catch { Write-Host \"HTTP connectivity: FAILED - $($_.Exception.Message)\" -ForegroundColor Red }\""</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: ssh -t -p 22146 i9-13ks "powershell -Command \"Write-Host 'Testing internet connectivity...' -ForegroundColor Cyan; Test-NetConnection -ComputerName google.com -Port 80 -InformationLevel Quiet; if ($?) { Write-Host 'Internet connection: OK' -ForegroundColor Green } else { Write-Host 'Internet connection: FAILED' -ForegroundColor Red }; Write-Host ''; Write-Host 'Testing DNS resolution...' -ForegroundColor Cyan; try { $result = Resolve-DnsName -Name google.com -ErrorAction Stop; Write-Host 'DNS resolution: OK' -ForegroundColor Green } catch { Write-Host 'DNS resolution: FAILED' -ForegroundColor Red }; Write-Host ''; Write-Host 'Testing HTTP connectivity...' -ForegroundColor Cyan; try { $response = Invoke-WebRequest -Uri 'https://www.google.com' -TimeoutSec 5 -UseBasicParsing -ErrorAction Stop; Write-Host 'HTTP connectivity: OK' -ForegroundColor Green } catch { Write-Host \"HTTP connectivity: FAILED - $($_.Exception.Message)\" -ForegroundColor Red }\""</summary>
```bash
ssh -t -p 22146 i9-13ks "powershell -Command \"Write-Host 'Testing internet connectivity...' -ForegroundColor Cyan; Test-NetConnection -ComputerName google.com -Port 80 -InformationLevel Quiet; if ($?) { Write-Host 'Internet connection: OK' -ForegroundColor Green } else { Write-Host 'Internet connection: FAILED' -ForegroundColor Red }; Write-Host ''; Write-Host 'Testing DNS resolution...' -ForegroundColor Cyan; try { $result = Resolve-DnsName -Name google.com -ErrorAction Stop; Write-Host 'DNS resolution: OK' -ForegroundColor Green } catch { Write-Host 'DNS resolution: FAILED' -ForegroundColor Red }; Write-Host ''; Write-Host 'Testing HTTP connectivity...' -ForegroundColor Cyan; try { $response = Invoke-WebRequest -Uri 'https://www.google.com' -TimeoutSec 5 -UseBasicParsing -ErrorAction Stop; Write-Host 'HTTP connectivity: OK' -ForegroundColor Green } catch { Write-Host \"HTTP connectivity: FAILED - $($_.Exception.Message)\" -ForegroundColor Red }\""
```
```
[?9001h[?1004h[?25l]0;Administrator: C:\WINDOWS\system32\conhost.exe[?25h\ : The term &#39;\&#39; is not recognized as the name of a cmdlet, function, script file, or operable program. Check the 
[?9001h[?1004h[?25l]0;Administrator: C:\WINDOWS\system32\conhost.exe[?25h\ : The term '\' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the 
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ \ Write-Host Testing internet connectivity... -ForegroundColor Cyan
@@ -265,9 +265,9 @@ Testing HTTP connectivity...
HTTP connectivity: OK
\: C:\Users\Nathan\AppData\Local\Temp\ps-script-f07861ff-1930-4e0c-a126-2a9512cba633.ps1:7
Line |
7 | . ctivity: FAILED - $($_.Exception.Message)\&quot; -ForegroundColor Red }\&quot;&quot;
7 | . ctivity: FAILED - $($_.Exception.Message)\" -ForegroundColor Red }\""
| ~~~
| The term &#39;\&#39; is not recognized as a name of a cmdlet, function, script file, or executable program. Check the
| The term '\' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the
| spelling of the name, or if a path was included, verify that the path is correct and try again.
```
@@ -286,14 +286,14 @@ Internet connectivity is working. Checking the Java installation:
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: ssh -t -p 22146 i9-13ks "powershell -Command \"Write-Host 'Checking Java installation...' -ForegroundColor Cyan; Write-Host ''; Write-Host 'Java executable path:' -ForegroundColor Yellow; Get-Command java -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Source; Write-Host ''; Write-Host 'JAVA_HOME environment variable:' -ForegroundColor Yellow; Write-Host \$env:JAVA_HOME; Write-Host ''; Write-Host 'JAVA_TOOL_OPTIONS:' -ForegroundColor Yellow; Write-Host \$env:JAVA_TOOL_OPTIONS; Write-Host ''; Write-Host 'PATH entries containing java:' -ForegroundColor Yellow; \$env:PATH -split ';' | Where-Object { \$_ -like '*java*' }; Write-Host ''; Write-Host 'Attempting java -version (this may fail):' -ForegroundColor Yellow; java -version 2>&1\""</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: ssh -t -p 22146 i9-13ks "powershell -Command \"Write-Host 'Checking Java installation...' -ForegroundColor Cyan; Write-Host ''; Write-Host 'Java executable path:' -ForegroundColor Yellow; Get-Command java -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Source; Write-Host ''; Write-Host 'JAVA_HOME environment variable:' -ForegroundColor Yellow; Write-Host \$env:JAVA_HOME; Write-Host ''; Write-Host 'JAVA_TOOL_OPTIONS:' -ForegroundColor Yellow; Write-Host \$env:JAVA_TOOL_OPTIONS; Write-Host ''; Write-Host 'PATH entries containing java:' -ForegroundColor Yellow; \$env:PATH -split ';' | Where-Object { \$_ -like '*java*' }; Write-Host ''; Write-Host 'Attempting java -version (this may fail):' -ForegroundColor Yellow; java -version 2>&1\""</summary>
```bash
ssh -t -p 22146 i9-13ks "powershell -Command \"Write-Host 'Checking Java installation...' -ForegroundColor Cyan; Write-Host ''; Write-Host 'Java executable path:' -ForegroundColor Yellow; Get-Command java -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Source; Write-Host ''; Write-Host 'JAVA_HOME environment variable:' -ForegroundColor Yellow; Write-Host \$env:JAVA_HOME; Write-Host ''; Write-Host 'JAVA_TOOL_OPTIONS:' -ForegroundColor Yellow; Write-Host \$env:JAVA_TOOL_OPTIONS; Write-Host ''; Write-Host 'PATH entries containing java:' -ForegroundColor Yellow; \$env:PATH -split ';' | Where-Object { \$_ -like '*java*' }; Write-Host ''; Write-Host 'Attempting java -version (this may fail):' -ForegroundColor Yellow; java -version 2>&1\""
```
```
[?9001h[?1004h[?25l]0;Administrator: C:\WINDOWS\system32\conhost.exe[?25h\ : The term &#39;\&#39; is not recognized as the name of a cmdlet, function, script file, or operable program. Check the [?9001l[?1004l
[?9001h[?1004h[?25l]0;Administrator: C:\WINDOWS\system32\conhost.exe[?25h\ : The term '\' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the [?9001l[?1004l
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ \ Write-Host Checking Java installation... -ForegroundColor Cyan
@@ -317,11 +317,11 @@ Connection to i9-13ks closed.
Attempting java -version (this may fail):
\$env:PATH: C:\Users\Nathan\AppData\Local\Temp\ps-script-2b04d60b-8094-4ccf-b84e-435f31732af2.ps1:118
Line |
118 | . entries containing java:&#39; -ForegroundColor Yellow; \$env:PATH -split .
118 | . entries containing java:' -ForegroundColor Yellow; \$env:PATH -split .
| ~~~~~~~~~~
| The term &#39;\$env:PATH&#39; is not recognized as a name of a cmdlet, function, script file, or executable program.
| The term '\$env:PATH' is not recognized as a name of a cmdlet, function, script file, or executable program.
| Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
openjdk version &quot;21.0.9&quot; 2025-10-21 LTS
openjdk version "21.0.9" 2025-10-21 LTS
OpenJDK Runtime Environment Temurin-21.0.9+10 (build 21.0.9+10-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.9+10 (build 21.0.9+10-LTS, mixed mode, sharing)
@@ -392,7 +392,7 @@ Updating the script to detect and handle invalid Java environment variables:
<tool-use data-tool-type="write" data-tool-name="search_replace">
<details><summary>Tool use: **code_edit** • Edit file: unified_sheepit_launcher.ps1</summary>
<details><summary>Tool use: **search_replace** • Edit file: unified_sheepit_launcher.ps1</summary>
**Chunk 1**
Lines added: 27, lines removed: 1
@@ -400,15 +400,15 @@ Lines added: 27, lines removed: 1
```diff
@@ -88,8 +88,34 @@
Write-Host &quot;Starting SheepIt client...&quot; -ForegroundColor Cyan
Write-Host "Starting SheepIt client..." -ForegroundColor Cyan
+
+ # Check and fix problematic environment variables that can cause boot class path errors
+ &#96;$envVarsFixed = &#96;$false
+
+ # Check JAVA_HOME - invalid values like &#39;\&#39; or empty can cause issues
+ # Check JAVA_HOME - invalid values like '\' or empty can cause issues
+ if (&#96;$env:JAVA_HOME) {
+ if (&#96;$env:JAVA_HOME -eq &#39;\&#39; -or &#96;$env:JAVA_HOME.Trim() -eq &#39;&#39; -or -not (Test-Path &#96;$env:JAVA_HOME)) {
+ Write-Host &quot;Warning: Invalid JAVA_HOME detected (&#39;&#96;$env:JAVA_HOME&#39;). Temporarily unsetting...&quot; -ForegroundColor Yellow
+ if (&#96;$env:JAVA_HOME -eq '\' -or &#96;$env:JAVA_HOME.Trim() -eq '' -or -not (Test-Path &#96;$env:JAVA_HOME)) {
+ Write-Host "Warning: Invalid JAVA_HOME detected ('&#96;$env:JAVA_HOME'). Temporarily unsetting..." -ForegroundColor Yellow
+ Remove-Item Env:\JAVA_HOME -ErrorAction SilentlyContinue
+ &#96;$envVarsFixed = &#96;$true
+ }
@@ -416,15 +416,15 @@ Lines added: 27, lines removed: 1
+
+ # Check JAVA_TOOL_OPTIONS - invalid values can cause boot class path errors
+ if (&#96;$env:JAVA_TOOL_OPTIONS) {
+ if (&#96;$env:JAVA_TOOL_OPTIONS -eq &#39;\&#39; -or &#96;$env:JAVA_TOOL_OPTIONS.Trim() -eq &#39;&#39;) {
+ Write-Host &quot;Warning: Invalid JAVA_TOOL_OPTIONS detected (&#39;&#96;$env:JAVA_TOOL_OPTIONS&#39;). Temporarily unsetting...&quot; -ForegroundColor Yellow
+ if (&#96;$env:JAVA_TOOL_OPTIONS -eq '\' -or &#96;$env:JAVA_TOOL_OPTIONS.Trim() -eq '') {
+ Write-Host "Warning: Invalid JAVA_TOOL_OPTIONS detected ('&#96;$env:JAVA_TOOL_OPTIONS'). Temporarily unsetting..." -ForegroundColor Yellow
+ Remove-Item Env:\JAVA_TOOL_OPTIONS -ErrorAction SilentlyContinue
+ &#96;$envVarsFixed = &#96;$true
+ }
+ }
+
+ if (&#96;$envVarsFixed) {
+ Write-Host &quot;Environment variables fixed. Proceeding with Java launch...&quot; -ForegroundColor Green
+ Write-Host "Environment variables fixed. Proceeding with Java launch..." -ForegroundColor Green
+ }
# Check Java version
@@ -432,7 +432,7 @@ Lines added: 27, lines removed: 1
- &#96;$javaVersion = java -version 2&gt;&amp;1 | Select-Object -First 1
+ &#96;$javaOutput = java -version 2&gt;&amp;1
+ &#96;$javaVersion = &#96;$javaOutput | Select-Object -First 1
Write-Host &quot;Java version: &#96;$javaVersion&quot; -ForegroundColor Gray
Write-Host "Java version: &#96;$javaVersion" -ForegroundColor Gray
}
```
@@ -446,7 +446,7 @@ Lines added: undefined, lines removed: 5
-
- # Check for problematic environment variables
- if (&#96;$env:JAVA_TOOL_OPTIONS) {
- Write-Host &quot;Warning: JAVA_TOOL_OPTIONS is set: &#96;$env:JAVA_TOOL_OPTIONS&quot; -ForegroundColor Yellow
- Write-Host "Warning: JAVA_TOOL_OPTIONS is set: &#96;$env:JAVA_TOOL_OPTIONS" -ForegroundColor Yellow
- }
# Use -XX:+IgnoreUnrecognizedVMOptions to handle any incompatible JVM args
@@ -458,9 +458,9 @@ Lines added: 1, lines removed: 1
```diff
@@ -116,5 +137,5 @@
catch {
Write-Host (&#39;Java execution error: {0}&#39; -f &#96;$_.Exception.Message) -ForegroundColor Red
- Write-Host &quot;If the error persists, try updating Java to a compatible version (Java 8 or Java 11+ recommended).&quot; -ForegroundColor Yellow
+ Write-Host &quot;If the error persists, try reinstalling Java (Temurin 21 recommended).&quot; -ForegroundColor Yellow
Write-Host ('Java execution error: {0}' -f &#96;$_.Exception.Message) -ForegroundColor Red
- Write-Host "If the error persists, try updating Java to a compatible version (Java 8 or Java 11+ recommended)." -ForegroundColor Yellow
+ Write-Host "If the error persists, try reinstalling Java (Temurin 21 recommended)." -ForegroundColor Yellow
throw
}
```
@@ -532,7 +532,7 @@ Checking the Git LFS upload status and diagnosing why it's stuck:
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git lfs ls-files</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git lfs ls-files</summary>
```bash
git lfs ls-files
@@ -568,7 +568,7 @@ cb3a30319d * sqlite/2025.11.19.11.05.13_flamenco-manager.sqlite
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --get-regexp lfs</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --get-regexp lfs</summary>
```bash
git config --get-regexp lfs
@@ -599,7 +599,7 @@ lfs.http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs.acc
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git remote -v</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git remote -v</summary>
```bash
git remote -v
@@ -628,7 +628,7 @@ Checking connectivity to the LFS server and push status:
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: Test-NetConnection -ComputerName nlhydra.ddns.net -Port 53000 -InformationLevel Detailed</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: Test-NetConnection -ComputerName nlhydra.ddns.net -Port 53000 -InformationLevel Detailed</summary>
```bash
Test-NetConnection -ComputerName nlhydra.ddns.net -Port 53000 -InformationLevel Detailed
@@ -656,14 +656,14 @@ TcpTestSucceeded : True
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git lfs push hydra main --dry-run 2>&1 | Select-Object -First 20</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git lfs push hydra main --dry-run 2>&1 | Select-Object -First 20</summary>
```bash
git lfs push hydra main --dry-run 2>&1 | Select-Object -First 20
```
```
Locking support detected on remote &quot;hydra&quot;. Consider enabling it with:
Locking support detected on remote "hydra". Consider enabling it with:
$ git config lfs.http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs.locksverify true
push a91a16b3c67c6127efcada482b5dc2ead9f1b0d57e8f7c1b1366659f922d8da3 =&gt; sqlite/2025.04.17.09.50.29_flamenco-manager.sqlite
push ad2e6be6369cae11490d23ec6e47e7e2fe9f1c8be195ef8df3f29470c2f9e8bc =&gt; sqlite/2025.04.21.09.53.46_flamenco-manager.sqlite
@@ -701,7 +701,7 @@ Network connectivity is fine. Checking SQLite file sizes and LFS push status:
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: Get-ChildItem sqlite\*.sqlite | Select-Object Name, @{Name="Size(MB)";Expression={[math]::Round($_.Length/1MB,2)}} | Format-Table -AutoSize</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: Get-ChildItem sqlite\*.sqlite | Select-Object Name, @{Name="Size(MB)";Expression={[math]::Round($_.Length/1MB,2)}} | Format-Table -AutoSize</summary>
```bash
Get-ChildItem sqlite\*.sqlite | Select-Object Name, @{Name="Size(MB)";Expression={[math]::Round($_.Length/1MB,2)}} | Format-Table -AutoSize
@@ -741,7 +741,7 @@ Name Size(MB)
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --get lfs.batch true</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --get lfs.batch true</summary>
```bash
git config --get lfs.batch true
@@ -752,7 +752,7 @@ git config --get lfs.batch true
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --get lfs.tustimeout</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --get lfs.tustimeout</summary>
```bash
git config --get lfs.tustimeout
@@ -778,7 +778,7 @@ Setting timeouts and enabling verbose output:
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config lfs.activitytimeout 300</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config lfs.activitytimeout 300</summary>
```bash
git config lfs.activitytimeout 300
@@ -789,7 +789,7 @@ git config lfs.activitytimeout 300
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config lfs.dialtimeout 60</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config lfs.dialtimeout 60</summary>
```bash
git config lfs.dialtimeout 60
@@ -800,7 +800,7 @@ git config lfs.dialtimeout 60
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config lfs.httptimeout 300</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config lfs.httptimeout 300</summary>
```bash
git config lfs.httptimeout 300
@@ -885,7 +885,7 @@ Checking LFS configuration for cached URLs pointing to the old server:
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: cd C:\Users\Nathan\Desktop\flamenco</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: cd C:\Users\Nathan\Desktop\flamenco</summary>
```bash
cd C:\Users\Nathan\Desktop\flamenco
@@ -896,7 +896,7 @@ cd C:\Users\Nathan\Desktop\flamenco
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --get-regexp "lfs.*url"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --get-regexp "lfs.*url"</summary>
```bash
git config --get-regexp "lfs.*url"
@@ -907,7 +907,7 @@ git config --get-regexp "lfs.*url"
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --get-regexp "remote.*url"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --get-regexp "remote.*url"</summary>
```bash
git config --get-regexp "remote.*url"
@@ -925,7 +925,7 @@ remote.hydra.pushurl http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git lfs env</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git lfs env</summary>
```bash
git lfs env
@@ -961,9 +961,9 @@ AccessUpload=basic
DownloadTransfers=basic,lfs-standalone-file,ssh
UploadTransfers=basic,lfs-standalone-file,ssh
GIT_EXEC_PATH=C:/Program Files/Git/mingw64/libexec/git-core
git config filter.lfs.process = &quot;git-lfs filter-process&quot;
git config filter.lfs.smudge = &quot;git-lfs smudge -- %f&quot;
git config filter.lfs.clean = &quot;git-lfs clean -- %f&quot;
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"
```
</details>
@@ -982,7 +982,7 @@ LFS shows endpoints for both remotes. Checking for cached LFS URLs and ensuring
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --global --get-regexp "lfs.*url"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --global --get-regexp "lfs.*url"</summary>
```bash
git config --global --get-regexp "lfs.*url"
@@ -993,7 +993,7 @@ git config --global --get-regexp "lfs.*url"
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: Get-Content .git\lfs\config 2>$null</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: Get-Content .git\lfs\config 2>$null</summary>
```bash
Get-Content .git\lfs\config 2>$null
@@ -1004,7 +1004,7 @@ Get-Content .git\lfs\config 2>$null
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --get-regexp "url.*192.168"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --get-regexp "url.*192.168"</summary>
```bash
git config --get-regexp "url.*192.168"
@@ -1015,7 +1015,7 @@ git config --get-regexp "url.*192.168"
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --get-regexp "url.*3000"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --get-regexp "url.*3000"</summary>
```bash
git config --get-regexp "url.*3000"
@@ -1067,7 +1067,7 @@ Checking `.git/config` for URL rewrite rules or redirects:
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --get-regexp "url\."</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --get-regexp "url\."</summary>
```bash
git config --get-regexp "url\."
@@ -1088,7 +1088,7 @@ Config looks correct. Checking DNS resolution and whether the hostname resolves
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: Resolve-DnsName nlhydra.ddns.net</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: Resolve-DnsName nlhydra.ddns.net</summary>
```bash
Resolve-DnsName nlhydra.ddns.net
@@ -1107,7 +1107,7 @@ nlhydra.ddns.net A 60 Answer 136.60.22
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: Get-Content C:\Windows\System32\drivers\etc\hosts | Select-String -Pattern "nlhydra|192.168.86.64"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: Get-Content C:\Windows\System32\drivers\etc\hosts | Select-String -Pattern "nlhydra|192.168.86.64"</summary>
```bash
Get-Content C:\Windows\System32\drivers\etc\hosts | Select-String -Pattern "nlhydra|192.168.86.64"
@@ -1118,7 +1118,7 @@ Get-Content C:\Windows\System32\drivers\etc\hosts | Select-String -Pattern "nlhy
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --global --get-regexp "url\."</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --global --get-regexp "url\."</summary>
```bash
git config --global --get-regexp "url\."
@@ -1139,7 +1139,7 @@ DNS resolves correctly. The LFS server may be redirecting. Setting the LFS endpo
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config lfs.url "http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config lfs.url "http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs"</summary>
```bash
git config lfs.url "http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs"
@@ -1150,7 +1150,7 @@ git config lfs.url "http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config remote.hydra.lfsurl "http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config remote.hydra.lfsurl "http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs"</summary>
```bash
git config remote.hydra.lfsurl "http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs"
@@ -1161,7 +1161,7 @@ git config remote.hydra.lfsurl "http://nlhydra.ddns.net:53000/Raincloud/Flamenco
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git lfs env | Select-String -Pattern "Endpoint|hydra"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git lfs env | Select-String -Pattern "Endpoint|hydra"</summary>
```bash
git lfs env | Select-String -Pattern "Endpoint|hydra"
@@ -1189,7 +1189,7 @@ Endpoints are set correctly. The server may be redirecting LFS requests to the i
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: $headers = @{'Authorization' = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(':'))}; try { $response = Invoke-WebRequest -Uri 'http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs' -Method GET -Headers $headers -MaximumRedirection 0 -ErrorAction Stop; Write-Host "Status: $($response.StatusCode)"; Write-Host "Headers: $($response.Headers | ConvertTo-Json)" } catch { Write-Host "Error: $($_.Exception.Message)"; if ($_.Exception.Response) { Write-Host "Status: $($_.Exception.Response.StatusCode)"; Write-Host "Location header: $($_.Exception.Response.Headers.Location)" } }</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: $headers = @{'Authorization' = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(':'))}; try { $response = Invoke-WebRequest -Uri 'http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs' -Method GET -Headers $headers -MaximumRedirection 0 -ErrorAction Stop; Write-Host "Status: $($response.StatusCode)"; Write-Host "Headers: $($response.Headers | ConvertTo-Json)" } catch { Write-Host "Error: $($_.Exception.Message)"; if ($_.Exception.Response) { Write-Host "Status: $($_.Exception.Response.StatusCode)"; Write-Host "Location header: $($_.Exception.Response.Headers.Location)" } }</summary>
```bash
$headers = @{'Authorization' = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(':'))}; try { $response = Invoke-WebRequest -Uri 'http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs' -Method GET -Headers $headers -MaximumRedirection 0 -ErrorAction Stop; Write-Host "Status: $($response.StatusCode)"; Write-Host "Headers: $($response.Headers | ConvertTo-Json)" } catch { Write-Host "Error: $($_.Exception.Message)"; if ($_.Exception.Response) { Write-Host "Status: $($_.Exception.Response.StatusCode)"; Write-Host "Location header: $($_.Exception.Response.Headers.Location)" } }
@@ -1217,28 +1217,28 @@ The 192.168.86.64:3000 redirect is likely from Gitea using an internal URL. Chec
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: $env:GIT_TRACE_CURL=1; $env:GIT_CURL_VERBOSE=1; git lfs push hydra main --dry-run 2>&1 | Select-Object -First 30</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: $env:GIT_TRACE_CURL=1; $env:GIT_CURL_VERBOSE=1; git lfs push hydra main --dry-run 2>&1 | Select-Object -First 30</summary>
```bash
$env:GIT_TRACE_CURL=1; $env:GIT_CURL_VERBOSE=1; git lfs push hydra main --dry-run 2>&1 | Select-Object -First 30
```
```
11:49:28.754589 trace git-lfs: exec: git &#39;-c&#39; &#39;filter.lfs.smudge=&#39; &#39;-c&#39; &#39;filter.lfs.clean=&#39; &#39;-c&#39; &#39;filter.lfs.process=&#39; &#39;-c&#39; &#39;filter.lfs.required=false&#39; &#39;remote&#39;
11:49:28.763987 trace git-lfs: exec: git &#39;-c&#39; &#39;filter.lfs.smudge=&#39; &#39;-c&#39; &#39;filter.lfs.clean=&#39; &#39;-c&#39; &#39;filter.lfs.process=&#39; &#39;-c&#39; &#39;filter.lfs.required=false&#39; &#39;rev-parse&#39; &#39;HEAD&#39; &#39;--symbolic-full-name&#39; &#39;HEAD&#39;
11:49:28.773355 trace git-lfs: exec: git &#39;-c&#39; &#39;filter.lfs.smudge=&#39; &#39;-c&#39; &#39;filter.lfs.clean=&#39; &#39;-c&#39; &#39;filter.lfs.process=&#39; &#39;-c&#39; &#39;filter.lfs.required=false&#39; &#39;rev-parse&#39; &#39;--git-dir&#39; &#39;--show-toplevel&#39;
11:49:28.783315 trace git-lfs: exec: git &#39;config&#39; &#39;--includes&#39; &#39;-l&#39;
11:49:28.797221 trace git-lfs: exec: git &#39;rev-parse&#39; &#39;--is-bare-repository&#39;
11:49:28.806822 trace git-lfs: exec: git &#39;config&#39; &#39;--includes&#39; &#39;-l&#39; &#39;--blob&#39; &#39;:.lfsconfig&#39;
11:49:28.816596 trace git-lfs: exec: git &#39;config&#39; &#39;--includes&#39; &#39;-l&#39; &#39;--blob&#39; &#39;HEAD:.lfsconfig&#39;
11:49:28.826481 trace git-lfs: exec: git &#39;-c&#39; &#39;filter.lfs.smudge=&#39; &#39;-c&#39; &#39;filter.lfs.clean=&#39; &#39;-c&#39; &#39;filter.lfs.process=&#39; &#39;-c&#39; &#39;filter.lfs.required=false&#39; &#39;rev-parse&#39; &#39;--git-dir&#39;
11:49:28.835234 trace git-lfs: exec: git &#39;-c&#39; &#39;filter.lfs.smudge=&#39; &#39;-c&#39; &#39;filter.lfs.clean=&#39; &#39;-c&#39; &#39;filter.lfs.process=&#39; &#39;-c&#39; &#39;filter.lfs.required=false&#39; &#39;remote&#39;
11:49:28.754589 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'remote'
11:49:28.763987 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'
11:49:28.773355 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' '--git-dir' '--show-toplevel'
11:49:28.783315 trace git-lfs: exec: git 'config' '--includes' '-l'
11:49:28.797221 trace git-lfs: exec: git 'rev-parse' '--is-bare-repository'
11:49:28.806822 trace git-lfs: exec: git 'config' '--includes' '-l' '--blob' ':.lfsconfig'
11:49:28.816596 trace git-lfs: exec: git 'config' '--includes' '-l' '--blob' 'HEAD:.lfsconfig'
11:49:28.826481 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' '--git-dir'
11:49:28.835234 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'remote'
11:49:28.844699 trace git-lfs: Upload refs [main] to remote hydra
11:49:28.844699 trace git-lfs: exec: git &#39;-c&#39; &#39;filter.lfs.smudge=&#39; &#39;-c&#39; &#39;filter.lfs.clean=&#39; &#39;-c&#39; &#39;filter.lfs.process=&#39; &#39;-c&#39; &#39;filter.lfs.required=false&#39; &#39;show-ref&#39;
11:49:28.854573 trace git-lfs: exec: git &#39;-c&#39; &#39;filter.lfs.smudge=&#39; &#39;-c&#39; &#39;filter.lfs.clean=&#39; &#39;-c&#39; &#39;filter.lfs.process=&#39; &#39;-c&#39; &#39;filter.lfs.required=false&#39; &#39;show-ref&#39;
11:49:28.868486 trace git-lfs: exec: git &#39;-c&#39; &#39;filter.lfs.smudge=&#39; &#39;-c&#39; &#39;filter.lfs.clean=&#39; &#39;-c&#39; &#39;filter.lfs.process=&#39; &#39;-c&#39; &#39;filter.lfs.required=false&#39; &#39;ls-remote&#39; &#39;--heads&#39; &#39;-q&#39; &#39;hydra&#39;
11:49:29.066093 trace git-lfs: creds: git credential fill (&quot;http&quot;, &quot;nlhydra.ddns.net:53000&quot;, &quot;&quot;)
11:49:29.066093 trace git-lfs: exec: git &#39;credential&#39; &#39;fill&#39;
11:49:28.844699 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'show-ref'
11:49:28.854573 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'show-ref'
11:49:28.868486 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'ls-remote' '--heads' '-q' 'hydra'
11:49:29.066093 trace git-lfs: creds: git credential fill ("http", "nlhydra.ddns.net:53000", "")
11:49:29.066093 trace git-lfs: exec: git 'credential' 'fill'
11:49:29.239065 trace git-lfs: Filled credentials for http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git
11:49:29.240308 trace git-lfs: HTTP: POST http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs/locks/verify
&gt; POST /Raincloud/Flamenco-Management.git/info/lfs/locks/verify HTTP/1.1
@@ -1249,7 +1249,7 @@ $env:GIT_TRACE_CURL=1; $env:GIT_CURL_VERBOSE=1; git lfs push hydra main --dry-ru
&gt; Content-Type: application/vnd.git-lfs+json; charset=utf-8
&gt; User-Agent: git-lfs/3.7.1 (GitHub; windows amd64; go 1.25.1; git b84b3384)
&gt;
{&quot;ref&quot;:{&quot;name&quot;:&quot;refs/heads/main&quot;}}11:49:29.330279 trace git-lfs: HTTP: 200
{"ref":{"name":"refs/heads/main"}}11:49:29.330279 trace git-lfs: HTTP: 200
&lt; HTTP/1.1 200 OK
@@ -1272,7 +1272,7 @@ The trace shows the correct URL. The redirect may occur during the actual upload
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --global url."http://nlhydra.ddns.net:53000/".insteadOf "http://192.168.86.64:3000/"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --global url."http://nlhydra.ddns.net:53000/".insteadOf "http://192.168.86.64:3000/"</summary>
```bash
git config --global url."http://nlhydra.ddns.net:53000/".insteadOf "http://192.168.86.64:3000/"
@@ -1283,7 +1283,7 @@ git config --global url."http://nlhydra.ddns.net:53000/".insteadOf "http://192.1
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --global url."http://nlhydra.ddns.net:53000/".insteadOf "http://192.168.86.64:3000"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --global url."http://nlhydra.ddns.net:53000/".insteadOf "http://192.168.86.64:3000"</summary>
```bash
git config --global url."http://nlhydra.ddns.net:53000/".insteadOf "http://192.168.86.64:3000"
@@ -1294,7 +1294,7 @@ git config --global url."http://nlhydra.ddns.net:53000/".insteadOf "http://192.1
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --global --get-regexp "url\."</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --global --get-regexp "url\."</summary>
```bash
git config --global --get-regexp "url\."
@@ -1347,7 +1347,7 @@ Investigating where the `192.168.86.64:3000` URL is coming from:
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git log --all --oneline --grep="192.168" | Select-Object -First 10</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git log --all --oneline --grep="192.168" | Select-Object -First 10</summary>
```bash
git log --all --oneline --grep="192.168" | Select-Object -First 10
@@ -1358,7 +1358,7 @@ git log --all --oneline --grep="192.168" | Select-Object -First 10
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git log --all --format="%H %s" | Select-String -Pattern "192.168" | Select-Object -First 5</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git log --all --format="%H %s" | Select-String -Pattern "192.168" | Select-Object -First 5</summary>
```bash
git log --all --format="%H %s" | Select-String -Pattern "192.168" | Select-Object -First 5
@@ -1369,7 +1369,7 @@ git log --all --format="%H %s" | Select-String -Pattern "192.168" | Select-Objec
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: Get-ChildItem .git\lfs\objects -Recurse -File | Select-Object -First 5 | ForEach-Object { Get-Content $_.FullName -Raw -ErrorAction SilentlyContinue | Select-String -Pattern "192.168" }</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: Get-ChildItem .git\lfs\objects -Recurse -File | Select-Object -First 5 | ForEach-Object { Get-Content $_.FullName -Raw -ErrorAction SilentlyContinue | Select-String -Pattern "192.168" }</summary>
```bash
Get-ChildItem .git\lfs\objects -Recurse -File | Select-Object -First 5 | ForEach-Object { Get-Content $_.FullName -Raw -ErrorAction SilentlyContinue | Select-String -Pattern "192.168" }
@@ -1380,7 +1380,7 @@ Get-ChildItem .git\lfs\objects -Recurse -File | Select-Object -First 5 | ForEach
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --show-origin --get-regexp ".*192\.168"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --show-origin --get-regexp ".*192\.168"</summary>
```bash
git config --show-origin --get-regexp ".*192\.168"
@@ -1391,7 +1391,7 @@ git config --show-origin --get-regexp ".*192\.168"
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: curl -v -I "http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs" 2>&1 | Select-String -Pattern "Location|192.168"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: curl -v -I "http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs" 2>&1 | Select-String -Pattern "Location|192.168"</summary>
```bash
curl -v -I "http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs" 2>&1 | Select-String -Pattern "Location|192.168"
@@ -1412,7 +1412,7 @@ Testing the server's HTTP response to see if it's sending redirects with the int
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: $response = Invoke-WebRequest -Uri "http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs/objects/batch" -Method POST -Headers @{'Content-Type'='application/vnd.git-lfs+json'} -Body '{"operation":"upload","transfers":["basic"],"objects":[]}' -MaximumRedirection 0 -ErrorAction SilentlyContinue; if ($response) { Write-Host "Status: $($response.StatusCode)"; $response.Headers } else { $_.Exception.Response.Headers.Location }</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: $response = Invoke-WebRequest -Uri "http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs/objects/batch" -Method POST -Headers @{'Content-Type'='application/vnd.git-lfs+json'} -Body '{"operation":"upload","transfers":["basic"],"objects":[]}' -MaximumRedirection 0 -ErrorAction SilentlyContinue; if ($response) { Write-Host "Status: $($response.StatusCode)"; $response.Headers } else { $_.Exception.Response.Headers.Location }</summary>
```bash
$response = Invoke-WebRequest -Uri "http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs/objects/batch" -Method POST -Headers @{'Content-Type'='application/vnd.git-lfs+json'} -Body '{"operation":"upload","transfers":["basic"],"objects":[]}' -MaximumRedirection 0 -ErrorAction SilentlyContinue; if ($response) { Write-Host "Status: $($response.StatusCode)"; $response.Headers } else { $_.Exception.Response.Headers.Location }
@@ -1421,9 +1421,9 @@ $response = Invoke-WebRequest -Uri "http://nlhydra.ddns.net:53000/Raincloud/Flam
```
Invoke-WebRequest: C:\Users\Nathan\AppData\Local\Temp\ps-script-b9add36d-bd8b-4f24-9ba1-386d2f5642d9.ps1:118
Line |
118 | $response = Invoke-WebRequest -Uri &quot;http://nlhydra.ddns.net:53000/Rai .
118 | $response = Invoke-WebRequest -Uri "http://nlhydra.ddns.net:53000/Rai .
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| {&quot;Message&quot;:&quot;Unsupported Media Type&quot;}
| {"Message":"Unsupported Media Type"}
```
</details>
@@ -1432,7 +1432,7 @@ Line |
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --show-origin --get-regexp "remote.*url"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --show-origin --get-regexp "remote.*url"</summary>
```bash
git config --show-origin --get-regexp "remote.*url"
@@ -1451,14 +1451,14 @@ file:.git/config remote.hydra.lfsurl http://nlhydra.ddns.net:53000/Raincloud/Fla
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git remote show hydra</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git remote show hydra</summary>
```bash
git remote show hydra
```
```
11:51:22.779521 http.c:915 == Info: Couldn&#39;t find host nlhydra.ddns.net in the .netrc file; using defaults
11:51:22.779521 http.c:915 == Info: Couldn't find host nlhydra.ddns.net in the .netrc file; using defaults
11:51:22.814889 http.c:915 == Info: Host nlhydra.ddns.net:53000 was resolved.
11:51:22.814889 http.c:915 == Info: IPv6: (none)
11:51:22.814889 http.c:915 == Info: IPv4: 136.60.227.240
@@ -1502,7 +1502,7 @@ git remote show hydra
11:51:22.903797 http.c:862 &lt;= Recv header, 0000000002 bytes (0x00000002)
11:51:22.903797 http.c:874 &lt;= Recv header:
11:51:22.903797 http.c:915 == Info: Connection #0 to host nlhydra.ddns.net:53000 left intact
11:51:22.904797 http.c:915 == Info: Couldn&#39;t find host nlhydra.ddns.net in the .netrc file; using defaults
11:51:22.904797 http.c:915 == Info: Couldn't find host nlhydra.ddns.net in the .netrc file; using defaults
11:51:22.904797 http.c:915 == Info: Reusing existing http: connection with host nlhydra.ddns.net
11:51:22.904797 http.c:862 =&gt; Send header, 0000000319 bytes (0x0000013f)
11:51:22.904797 http.c:874 =&gt; Send header: POST /Raincloud/Flamenco-Management.git/git-upload-pack HTTP/1.1
@@ -1683,7 +1683,7 @@ The remote is still pointing to the old HTTP URL with port 53000. Checking and u
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git remote -v</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git remote -v</summary>
```bash
git remote -v
@@ -1702,7 +1702,7 @@ origin http://10.1.10.3:30008/TalkingHeads/Flamenco-Management.git (push)
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --get-regexp "remote\.hydra"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --get-regexp "remote\.hydra"</summary>
```bash
git config --get-regexp "remote\.hydra"
@@ -1713,7 +1713,7 @@ git config --get-regexp "remote\.hydra"
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --get-regexp "lfs.*hydra"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --get-regexp "lfs.*hydra"</summary>
```bash
git config --get-regexp "lfs.*hydra"
@@ -1747,7 +1747,7 @@ The remote URL is correct, but there's an old LFS configuration pointing to the
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --get-regexp "lfs"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --get-regexp "lfs"</summary>
```bash
git config --get-regexp "lfs"
@@ -1793,7 +1793,7 @@ Old LFS configurations still reference the HTTP URL with port 53000. Updating th
<tool-use data-tool-type="write" data-tool-name="search_replace">
<details><summary>Tool use: **code_edit** • Edit file: .git/config</summary>
<details><summary>Tool use: **search_replace** • Edit file: .git/config</summary>
**Chunk 1**
Lines added: 1, lines removed: 1
@@ -1804,7 +1804,7 @@ Lines added: 1, lines removed: 1
httptimeout = 300
- url = http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs
+ url = https://nlhydra.ddns.net/Raincloud/Flamenco-Management.git/info/lfs
[filter &quot;lfs&quot;]
[filter "lfs"]
clean = git-lfs clean -- %f
```
@@ -1816,23 +1816,23 @@ Lines added: 1, lines removed: 1
<tool-use data-tool-type="write" data-tool-name="search_replace">
<details><summary>Tool use: **code_edit** • Edit file: .git/config</summary>
<details><summary>Tool use: **search_replace** • Edit file: .git/config</summary>
**Chunk 1**
Lines added: 2, lines removed: 2
```diff
@@ -26,8 +26,8 @@
[lfs &quot;http://10.1.10.3:30008/TalkingHeads/Flamenco-Management.git/info/lfs&quot;]
[lfs "http://10.1.10.3:30008/TalkingHeads/Flamenco-Management.git/info/lfs"]
access = basic
- [remote &quot;Hydra&quot;]
[remote &quot;hydra&quot;]
- [remote "Hydra"]
[remote "hydra"]
url = https://nlhydra.ddns.net/Raincloud/Flamenco-Management.git
- [lfs &quot;http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs&quot;]
- [lfs "http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs"]
+ fetch = +refs/heads/*:refs/remotes/hydra/*
+ [lfs &quot;https://nlhydra.ddns.net/Raincloud/Flamenco-Management.git/info/lfs&quot;]
+ [lfs "https://nlhydra.ddns.net/Raincloud/Flamenco-Management.git/info/lfs"]
access = basic
[remote &quot;hydra&quot;]
[remote "hydra"]
```
</details>
@@ -1843,16 +1843,16 @@ Lines added: 2, lines removed: 2
<tool-use data-tool-type="write" data-tool-name="search_replace">
<details><summary>Tool use: **code_edit** • Edit file: .git/config</summary>
<details><summary>Tool use: **search_replace** • Edit file: .git/config</summary>
**Chunk 1**
Lines added: undefined, lines removed: 2
```diff
@@ -31,5 +31,3 @@
[lfs &quot;https://nlhydra.ddns.net/Raincloud/Flamenco-Management.git/info/lfs&quot;]
[lfs "https://nlhydra.ddns.net/Raincloud/Flamenco-Management.git/info/lfs"]
access = basic
- [remote &quot;hydra&quot;]
- [remote "hydra"]
- fetch = +refs/heads/*:refs/remotes/hydra/*
```
@@ -1874,7 +1874,7 @@ Removing the old LFS access configuration for the HTTP URL:
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --unset "lfs.http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs.access"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --unset "lfs.http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs.access"</summary>
```bash
git config --unset "lfs.http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Management.git/info/lfs.access"
@@ -1885,7 +1885,7 @@ git config --unset "lfs.http://nlhydra.ddns.net:53000/Raincloud/Flamenco-Managem
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --unset "remote.hydra.lfsurl"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --unset "remote.hydra.lfsurl"</summary>
```bash
git config --unset "remote.hydra.lfsurl"
@@ -1914,7 +1914,7 @@ Removing the old URL rewrite rule that's no longer needed:
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --global --unset "url.http://nlhydra.ddns.net:53000/.insteadof"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --global --unset "url.http://nlhydra.ddns.net:53000/.insteadof"</summary>
```bash
git config --global --unset "url.http://nlhydra.ddns.net:53000/.insteadof"
@@ -1925,7 +1925,7 @@ git config --global --unset "url.http://nlhydra.ddns.net:53000/.insteadof"
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git lfs env | Select-String -Pattern "Endpoint|hydra"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git lfs env | Select-String -Pattern "Endpoint|hydra"</summary>
```bash
git lfs env | Select-String -Pattern "Endpoint|hydra"
@@ -1943,7 +1943,7 @@ Endpoint (hydra)=https://nlhydra.ddns.net/Raincloud/Flamenco-Management.git/info
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git remote show hydra</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git remote show hydra</summary>
```bash
git remote show hydra
@@ -1972,7 +1972,7 @@ Configuration updated. The remote and LFS endpoints now use the HTTPS URL withou
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --get-regexp ".*nlhydra"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --get-regexp ".*nlhydra"</summary>
```bash
git config --get-regexp ".*nlhydra"
@@ -2000,7 +2000,7 @@ Removing the old credential configuration for the HTTP URL:
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --global --unset "credential.http://nlhydra.ddns.net:53000.provider"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --global --unset "credential.http://nlhydra.ddns.net:53000.provider"</summary>
```bash
git config --global --unset "credential.http://nlhydra.ddns.net:53000.provider"
@@ -2011,7 +2011,7 @@ git config --global --unset "credential.http://nlhydra.ddns.net:53000.provider"
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git config --get-regexp ".*nlhydra"</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git config --get-regexp ".*nlhydra"</summary>
```bash
git config --get-regexp ".*nlhydra"
@@ -2043,7 +2043,6 @@ _**Agent (model default, mode Agent)**_
---
Git LFS stores endpoint configurations separately from the remote URL, so changing the remote doesn't update them automatically.
When you run `git remote set-url hydra <new-url>`, Git updates the remote URL, but Git LFS keeps its own endpoint entries like:
@@ -2059,7 +2058,7 @@ Checking if there's a way to make LFS auto-detect from the remote:
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **command** • Run command: git lfs env --help 2>&1 | Select-String -Pattern "endpoint|remote" -Context 2</summary>
<details><summary>Tool use: **run_terminal_cmd** • Run command: git lfs env --help 2>&1 | Select-String -Pattern "endpoint|remote" -Context 2</summary>
```bash
git lfs env --help 2>&1 | Select-String -Pattern "endpoint|remote" -Context 2
@@ -2086,7 +2085,6 @@ git lfs env --help 2>&1 | Select-String -Pattern "endpoint|remote" -Context 2
---
Git LFS doesn't automatically update when you change a remote URL. This is a known limitation.
Why it works this way:

View File

@@ -31,7 +31,7 @@ _**Agent (model gpt-5.1-codex, mode Agent)**_
<tool-use data-tool-type="generic" data-tool-name="list_dir">
<details>
<summary>Tool use: **list_directory** • Listed directory undefined • **0** results</summary>
<summary>Tool use: **list_dir** • Listed directory, 0 results</summary>
No results found
</details>
@@ -39,7 +39,254 @@ No results found
---
<think><details><summary>Thought Process</summary>
**Diagnosing worker connection failures**</details></think>
---
<tool-use data-tool-type="read" data-tool-name="read_file">
<details><summary>Tool use: **read_file** • Read file: scripts/TalkingHeads cycles_optix_gpu.js</summary>
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Checking for relevant scripts**</details></think>
---
<tool-use data-tool-type="read" data-tool-name="read_file">
<details><summary>Tool use: **read_file** • Read file: scripts/outline.txt</summary>
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Investigating worker failure context**</details></think>
---
<tool-use data-tool-type="read" data-tool-name="read_file">
<details><summary>Tool use: **read_file** • Read file: unified_flamenco_launcher.ps1</summary>
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Analyzing SSH exec request failure**
Im piecing together why the SSH “exec request failed on channel 0” error occurs when the script tries running `powershell -EncodedCommand` remotely. It looks like the remote hosts may lack PowerShell, use restrictive SSH configs, or have quoting and command invocation issues; Im considering host OS differences, SSH subsystems, and command formatting problems to guide a helpful troubleshooting response.</details></think>
---
<tool-use data-tool-type="read" data-tool-name="read_file">
<details><summary>Tool use: **read_file** • Read file: unified_flamenco_launcher.bat</summary>
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Analyzing remote SSH exec failure**</details></think>
---
<tool-use data-tool-type="search" data-tool-name="grep">
<details>
<summary>Tool use: **grep** • Grep for "exec request failed" in "." • 0 matches</summary>
Output mode: content
_No matches found_
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Analyzing SSH exec failure causes**
I'm gathering possible reasons why all workers fail with "exec request failed on channel 0," focusing on remote SSH command execution limits, shell configuration, command length limits on Windows, and potential remote server restrictions or misconfigurations. Im considering the encoded PowerShell command size, quoting issues, remote subsystems, ForceCommand settings, and suggesting diagnostic steps to help troubleshoot the problem.
**Proposing remote script streaming approach**
I'm exploring a way to fix the failure by modifying the script to stream the remote PowerShell code via SSH standard input instead of using long encoded commands, which may exceed length limits or cause quoting issues. Im outlining implementation ideas to pipe the script through SSH to remote `powershell -Command -` to avoid exec errors and suggesting a plan to update the launcher accordingly.
**Detailing PowerShell SSH streaming implementation**
I'm outlining a helper to stream the worker script to the remote PowerShell session via SSH by piping the script through standard input using `Start-Process` with redirected input. Im carefully considering argument quoting, how to pass SSH options and commands, and PowerShells handling of reading scripts from stdin, while also weighing alternatives like copying a script file to the remote host for execution.</details></think>
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **run_terminal_cmd** • Run command: cd C:\Users\Nathan\Desktop\flamenco
python - <<'PY'
import re, base64
from pathlib import Path
text = Path('unified_flamenco_launcher.ps1').read_text()
patterns = [r"function Get-RemoteStandardWorkerCommand \{\s*@'([\s\S]+?)'@", r"function Get-RemoteCmdWorkerCommand \{\s*@'([\s\S]+?)'@", r"function Get-RemoteSimplifiedCmdWorkerCommand \{\s*@'([\s\S]+?)'@"]
for pat in patterns:
m = re.search(pat, text)
if m:
body = m.group(1)
utf16 = body.encode('utf-16le')
b64 = base64.b64encode(utf16)
print(pat.split()[1], 'chars', len(body), 'utf16 bytes', len(utf16), 'b64 len', len(b64))
PY</summary>
```bash
cd C:\Users\Nathan\Desktop\flamenco
python - <<'PY'
import re, base64
from pathlib import Path
text = Path('unified_flamenco_launcher.ps1').read_text()
patterns = [r"function Get-RemoteStandardWorkerCommand \{\s*@'([\s\S]+?)'@", r"function Get-RemoteCmdWorkerCommand \{\s*@'([\s\S]+?)'@", r"function Get-RemoteSimplifiedCmdWorkerCommand \{\s*@'([\s\S]+?)'@"]
for pat in patterns:
m = re.search(pat, text)
if m:
body = m.group(1)
utf16 = body.encode('utf-16le')
b64 = base64.b64encode(utf16)
print(pat.split()[1], 'chars', len(body), 'utf16 bytes', len(utf16), 'b64 len', len(b64))
PY
```
```
ParserError: C:\Users\Nathan\AppData\Local\Temp\ps-script-4890d486-a555-41a3-8a38-e515f235a750.ps1:8
Line |
8 | python - &lt;&lt;'PY'
| ~
| Missing file specification after redirection operator.
```
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Exploring PowerShell heredoc limits**</details></think>
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **run_terminal_cmd** • Run command: cd C:\Users\Nathan\Desktop\flamenco
python -c "import re, base64, pathlib; text = pathlib.Path('unified_flamenco_launcher.ps1').read_text();
import itertools
patterns = ['function Get-RemoteStandardWorkerCommand {', 'function Get-RemoteCmdWorkerCommand {', 'function Get-RemoteSimplifiedCmdWorkerCommand {']
import sys
for name in patterns:
idx = text.find(name)
if idx == -1:
continue
start = text.find("@'", idx)
end = text.find("'@", start+2)
body = text[start+2:end]
utf16 = body.encode('utf-16le')
b64 = base64.b64encode(utf16)
print(name.split()[1], 'chars', len(body), 'utf16 bytes', len(utf16), 'b64 len', len(b64))
"</summary>
```bash
cd C:\Users\Nathan\Desktop\flamenco
python -c "import re, base64, pathlib; text = pathlib.Path('unified_flamenco_launcher.ps1').read_text();
import itertools
patterns = ['function Get-RemoteStandardWorkerCommand {', 'function Get-RemoteCmdWorkerCommand {', 'function Get-RemoteSimplifiedCmdWorkerCommand {']
import sys
for name in patterns:
idx = text.find(name)
if idx == -1:
continue
start = text.find("@'", idx)
end = text.find("'@", start+2)
body = text[start+2:end]
utf16 = body.encode('utf-16le')
b64 = base64.b64encode(utf16)
print(name.split()[1], 'chars', len(body), 'utf16 bytes', len(utf16), 'b64 len', len(b64))
"
```
```
ParserError: C:\Users\Nathan\AppData\Local\Temp\ps-script-a0e83e85-1956-43ab-ab83-9ea6c4a2f958.ps1:16
Line |
16 | start = text.find("@'", idx)
| ~
| No characters are allowed after a here-string header but before the end of the line.
```
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Resolving PowerShell string parsing issues**</details></think>
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">
<details><summary>Tool use: **run_terminal_cmd** • Run command: cd C:\Users\Nathan\Desktop\flamenco
@"
import re, base64, pathlib
text = pathlib.Path('unified_flamenco_launcher.ps1').read_text()
patterns = ['function Get-RemoteStandardWorkerCommand {', 'function Get-RemoteCmdWorkerCommand {', 'function Get-RemoteSimplifiedCmdWorkerCommand {']
for name in patterns:
idx = text.find(name)
if idx == -1:
continue
start = text.find("@'", idx)
end = text.find("'@", start+2)
body = text[start+2:end]
utf16 = body.encode('utf-16le')
b64 = base64.b64encode(utf16)
print(name.split()[1], 'chars', len(body), 'utf16 bytes', len(utf16), 'b64 len', len(b64))
"@ | Set-Content measure.py
python measure.py
Remove-Item measure.py
</summary>
```bash
cd C:\Users\Nathan\Desktop\flamenco
@"
import re, base64, pathlib
text = pathlib.Path('unified_flamenco_launcher.ps1').read_text()
patterns = ['function Get-RemoteStandardWorkerCommand {', 'function Get-RemoteCmdWorkerCommand {', 'function Get-RemoteSimplifiedCmdWorkerCommand {']
for name in patterns:
idx = text.find(name)
if idx == -1:
continue
start = text.find("@'", idx)
end = text.find("'@", start+2)
body = text[start+2:end]
utf16 = body.encode('utf-16le')
b64 = base64.b64encode(utf16)
print(name.split()[1], 'chars', len(body), 'utf16 bytes', len(utf16), 'b64 len', len(b64))
"@ | Set-Content measure.py
python measure.py
Remove-Item measure.py
```
```
Get-RemoteStandardWorkerCommand chars 2690 utf16 bytes 5380 b64 len 7176
Get-RemoteCmdWorkerCommand chars 2439 utf16 bytes 4878 b64 len 6504
Get-RemoteSimplifiedCmdWorkerCommand chars 2012 utf16 bytes 4024 b64 len 5368
```
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Evaluating remote SSH exec failure causes**</details></think>
---

File diff suppressed because one or more lines are too long

29
persistent_workers.md Normal file
View File

@@ -0,0 +1,29 @@
## Persistent Remote Worker Architecture
This repository now includes a small controller/attach framework that keeps both Flamenco and SheepIt workers running on each remote Windows host even after the SSH session closes.
### Components
| File | Purpose |
| --- | --- |
| `remote_worker_controller.ps1` | Runs on each remote host. Launches the real worker process (Flamenco or SheepIt), redirects its stdout/stderr to a log file, listens for commands, and restarts the worker if it crashes. |
| `remote_worker_attach.ps1` | Also runs remotely. Streams the controllers log file back to the local SSH session and forwards commands (`pause`, `resume`, `quit`, etc.) to the workers stdin. It can also be invoked in a `-CommandOnly` mode to send a single command without attaching. |
| `unified_flamenco_launcher.ps1` / `unified_sheepit_launcher.ps1` | Local launchers that copy the helper scripts to each host, start controllers in the background, and open attach sessions as requested. |
All metadata, logs and helper scripts live under `C:\ProgramData\UnifiedWorkers\<worker-type>\<worker-name>\`.
### Typical Flow
1. **Start/attach**: The launcher ensures the controller + payload are present on the target host, starts the controller through `Start-Process`, then launches `remote_worker_attach.ps1` via SSH so you can see live output and type commands. Closing the SSH window only ends the attach session—the worker keeps running.
2. **Reattach**: Run the launcher again and choose the same worker. If a controller reports that a worker is already running, the launcher simply opens another attach session.
3. **Pause/Resume/Quit all (SheepIt)**: The SheepIt launcher now exposes menu options that iterate over every enabled worker and invoke the attach helper in `-CommandOnly` mode to send the requested command.
### Manual Verification Checklist
1. **Controller deployment**: From the launcher, start a worker once and confirm `%ProgramData%\UnifiedWorkers` appears on the remote host with `controller.ps1`, `attach-helper.ps1`, `logs\worker.log`, and `state\worker-info.json`.
2. **Persistence**: Attach to a worker, close the SSH window, then reattach. The log stream should resume and the worker PID reported in metadata should remain unchanged.
3. **Command channel**: While attached, type `pause`, `resume`, and `quit`. The controller should log each command and the worker should react accordingly. Repeat the same commands using the SheepIt “Pause/Resume/Quit All” menu entries to validate the automation path.
4. **Failure recovery**: Manually terminate the worker process on a remote host. The controller should log the exit, update metadata, and restart the worker up to the configured retry limit.
These steps ensure both Flamenco and SheepIt workflows operate as intended with the new persistent worker model. Adjust the retry/backoff values inside `remote_worker_controller.ps1` if you need more aggressive or conservative restart behavior.

116
remote_worker_attach.ps1 Normal file
View File

@@ -0,0 +1,116 @@
param(
[Parameter(Mandatory = $true)]
[string]$WorkerName,
[Parameter(Mandatory = $true)]
[string]$WorkerType,
[string]$DataRoot = (Join-Path ([Environment]::GetFolderPath('LocalApplicationData')) 'UnifiedWorkers'),
[switch]$CommandOnly,
[string]$Command
)
$ErrorActionPreference = 'Stop'
function Get-WorkerPaths {
param([string]$Root, [string]$Type, [string]$Name)
$instanceRoot = Join-Path -Path (Join-Path -Path $Root -ChildPath $Type) -ChildPath $Name
return [pscustomobject]@{
Metadata = Join-Path -Path $instanceRoot -ChildPath 'state\worker-info.json'
Command = Join-Path -Path $instanceRoot -ChildPath 'state\commands.txt'
Log = Join-Path -Path $instanceRoot -ChildPath 'logs\worker.log'
}
}
$paths = Get-WorkerPaths -Root $DataRoot -Type $WorkerType -Name $WorkerName
if (-not (Test-Path $paths.Metadata)) {
Write-Host "No worker metadata found for $WorkerName ($WorkerType)." -ForegroundColor Red
exit 1
}
try {
$metadata = Get-Content -Path $paths.Metadata -Raw | ConvertFrom-Json
}
catch {
Write-Host "Unable to read worker metadata: $($_.Exception.Message)" -ForegroundColor Red
exit 1
}
if (Test-Path $paths.Log) {
# ensure log file exists but do not truncate
$null = (Get-Item $paths.Log)
} else {
New-Item -Path $paths.Log -ItemType File -Force | Out-Null
}
if (-not (Test-Path $paths.Command)) {
New-Item -Path $paths.Command -ItemType File -Force | Out-Null
}
function Send-WorkerCommand {
param([string]$Value)
$clean = $Value.Trim()
if (-not $clean) {
return
}
Add-Content -Path $paths.Command -Value $clean -Encoding UTF8
Write-Host "Sent command '$clean' to $WorkerName." -ForegroundColor DarkGray
}
if ($CommandOnly) {
if (-not $Command) {
Write-Host "CommandOnly flag set but no command provided." -ForegroundColor Red
exit 1
}
Send-WorkerCommand -Value $Command
exit 0
}
Write-Host "Attaching to $WorkerName ($WorkerType) logs." -ForegroundColor Cyan
Write-Host "Type commands and press Enter. Type 'detach' to exit session." -ForegroundColor Yellow
$logJob = Start-Job -ScriptBlock {
param($LogPath)
Get-Content -Path $LogPath -Tail 50 -Wait
} -ArgumentList $paths.Log
try {
while ($true) {
$input = Read-Host "> "
if ($null -eq $input) {
continue
}
$normalized = $input.Trim()
if ($normalized.StartsWith(':')) {
$normalized = $normalized.TrimStart(':').Trim()
}
if ($normalized.Length -eq 0) {
continue
}
if ($normalized.ToLowerInvariant() -eq 'detach') {
break
}
Send-WorkerCommand -Value $input
}
}
finally {
if ($logJob) {
Stop-Job -Job $logJob -ErrorAction SilentlyContinue
Receive-Job -Job $logJob -ErrorAction SilentlyContinue | Out-Null
Remove-Job -Job $logJob -ErrorAction SilentlyContinue
}
Write-Host "Detached from worker $WorkerName." -ForegroundColor Cyan
}

View File

@@ -0,0 +1,407 @@
param(
[Parameter(Mandatory = $true)]
[string]$WorkerName,
[Parameter(Mandatory = $true)]
[string]$WorkerType,
[string]$PayloadBase64,
[string]$PayloadBase64Path,
[string]$DataRoot = (Join-Path ([Environment]::GetFolderPath('LocalApplicationData')) 'UnifiedWorkers'),
[int]$MaxRestarts = 5,
[int]$RestartDelaySeconds = 10
)
$ErrorActionPreference = 'Stop'
try {
if ($Host -and $Host.Runspace) {
[System.Management.Automation.Runspaces.Runspace]::DefaultRunspace = $Host.Runspace
}
}
catch {
# Ignore runspace assignment errors - not critical for non-interactive execution
}
# region Path setup
$workerRoot = Join-Path -Path $DataRoot -ChildPath $WorkerType
$instanceRoot = Join-Path -Path $workerRoot -ChildPath $WorkerName
New-Item -ItemType Directory -Path $instanceRoot -Force | Out-Null
$logsRoot = Join-Path -Path $instanceRoot -ChildPath 'logs'
$stateRoot = Join-Path -Path $instanceRoot -ChildPath 'state'
New-Item -ItemType Directory -Path $logsRoot -Force | Out-Null
New-Item -ItemType Directory -Path $stateRoot -Force | Out-Null
$logPath = Join-Path -Path $logsRoot -ChildPath 'worker.log'
$metaPath = Join-Path -Path $stateRoot -ChildPath 'worker-info.json'
$commandPath = Join-Path -Path $stateRoot -ChildPath 'commands.txt'
$payloadPath = Join-Path -Path $stateRoot -ChildPath "payload.ps1"
# endregion
# region Logging
try {
$logStream = [System.IO.FileStream]::new(
$logPath,
[System.IO.FileMode]::Append,
[System.IO.FileAccess]::Write,
[System.IO.FileShare]::ReadWrite
)
$logWriter = [System.IO.StreamWriter]::new($logStream, [System.Text.Encoding]::UTF8)
$logWriter.AutoFlush = $true
}
catch {
# If we can't open the log file, write error to metadata and exit
$errorMeta = [pscustomobject]@{
WorkerName = $WorkerName
WorkerType = $WorkerType
Status = 'error'
ControllerPid = $PID
WorkerPid = $null
Restarts = 0
LastExitCode = 1
LogPath = $logPath
CommandPath = $commandPath
PayloadPath = $payloadPath
UpdatedAtUtc = (Get-Date).ToUniversalTime()
ErrorMessage = "Failed to open log file: $($_.Exception.Message)"
}
$errorMeta | ConvertTo-Json -Depth 5 | Set-Content -Path $metaPath -Encoding UTF8 -ErrorAction SilentlyContinue
Write-Error "Controller failed to initialize: $($_.Exception.Message)"
exit 1
}
# Create C# event handler class that doesn't require PowerShell runspace
if (-not ("UnifiedWorkers.ProcessLogHandler" -as [type])) {
$csharpCode = @'
using System;
using System.Diagnostics;
using System.IO;
namespace UnifiedWorkers
{
public sealed class ProcessLogHandler
{
private readonly TextWriter _writer;
private readonly string _prefix;
private readonly object _lock = new object();
public ProcessLogHandler(TextWriter writer, string prefix)
{
_writer = writer ?? throw new ArgumentNullException("writer");
_prefix = prefix ?? throw new ArgumentNullException("prefix");
}
public void OnDataReceived(object sender, DataReceivedEventArgs e)
{
if (e == null || string.IsNullOrEmpty(e.Data))
{
return;
}
lock (_lock)
{
try
{
var timestamp = DateTime.UtcNow.ToString("u");
_writer.WriteLine(string.Format("[{0} {1}] {2}", _prefix, timestamp, e.Data));
_writer.Flush();
}
catch
{
// Ignore write errors to prevent cascading failures
}
}
}
}
}
'@
Add-Type -TypeDefinition $csharpCode -ErrorAction Stop
}
function Write-LogLine {
param(
[string]$Prefix,
[string]$Message
)
if (-not $logWriter) { return }
$timestamp = (Get-Date).ToString('u')
$logWriter.WriteLine("[$Prefix $timestamp] $Message")
}
function Write-ControllerLog {
param([string]$Message)
Write-LogLine -Prefix 'CTRL' -Message $Message
}
function Write-FatalLog {
param([string]$Message)
try {
Write-ControllerLog $Message
}
catch {
$timestamp = (Get-Date).ToString('u')
$fallback = "[CTRL $timestamp] $Message"
try {
[System.IO.File]::AppendAllText($logPath, $fallback + [Environment]::NewLine, [System.Text.Encoding]::UTF8)
}
catch {
# last resort: write to host
Write-Error $fallback
}
}
}
# endregion
# region Helpers
function Resolve-PayloadBase64 {
if ($PayloadBase64) {
return $PayloadBase64.Trim()
}
if ($PayloadBase64Path) {
if (-not (Test-Path $PayloadBase64Path)) {
throw "Payload file '$PayloadBase64Path' not found."
}
$content = Get-Content -Path $PayloadBase64Path -Raw
if ([string]::IsNullOrWhiteSpace($content)) {
throw "Payload file '$PayloadBase64Path' is empty."
}
return $content.Trim()
}
throw "No payload data provided to controller."
}
function Write-Metadata {
param(
[string]$Status,
[nullable[int]]$WorkerPid = $null,
[nullable[int]]$ControllerPid = $PID,
[int]$Restarts = 0,
[nullable[int]]$LastExitCode = $null
)
$payload = [pscustomobject]@{
WorkerName = $WorkerName
WorkerType = $WorkerType
Status = $Status
ControllerPid = $ControllerPid
WorkerPid = $WorkerPid
Restarts = $Restarts
LastExitCode = $LastExitCode
LogPath = $logPath
CommandPath = $commandPath
PayloadPath = $payloadPath
UpdatedAtUtc = (Get-Date).ToUniversalTime()
}
$payload | ConvertTo-Json -Depth 5 | Set-Content -Path $metaPath -Encoding UTF8
}
function Get-PendingCommands {
if (-not (Test-Path $commandPath)) {
return @()
}
try {
$lines = Get-Content -Path $commandPath -ErrorAction Stop
Remove-Item -Path $commandPath -Force -ErrorAction SilentlyContinue
return $lines | Where-Object { -not [string]::IsNullOrWhiteSpace($_) }
}
catch {
return @()
}
}
# endregion
try {
# record initial state before launching worker
Write-Metadata -Status 'initializing' -WorkerPid $null -ControllerPid $PID -Restarts 0
$resolvedPayloadBase64 = Resolve-PayloadBase64
$PayloadBase64 = $resolvedPayloadBase64
try {
# Write payload script to disk
# The payload is base64-encoded UTF-16 (Unicode), so decode it properly
Write-ControllerLog "Decoding payload base64 (length: $($resolvedPayloadBase64.Length))"
$payloadBytes = [Convert]::FromBase64String($resolvedPayloadBase64)
Write-ControllerLog "Decoded payload to $($payloadBytes.Length) bytes"
# Convert UTF-16 bytes back to string, then write as UTF-8 (PowerShell's preferred encoding)
$payloadText = [Text.Encoding]::Unicode.GetString($payloadBytes)
[IO.File]::WriteAllText($payloadPath, $payloadText, [Text.Encoding]::UTF8)
Write-ControllerLog "Payload written to $payloadPath ($($payloadText.Length) characters)"
}
catch {
Write-FatalLog "Unable to write payload: $($_.Exception.Message)"
if ($_.Exception.InnerException) {
Write-FatalLog "Inner exception: $($_.Exception.InnerException.Message)"
}
throw
}
$restartCount = 0
$controllerPid = $PID
while ($restartCount -le $MaxRestarts) {
try {
# Initialize worker process
$psi = [System.Diagnostics.ProcessStartInfo]::new()
$pwsh = Get-Command pwsh -ErrorAction SilentlyContinue
if ($pwsh) {
$psi.FileName = $pwsh.Source
}
else {
$psi.FileName = (Get-Command powershell -ErrorAction Stop).Source
}
$psi.Arguments = "-NoLogo -NoProfile -ExecutionPolicy Bypass -File `"$payloadPath`""
$psi.UseShellExecute = $false
$psi.RedirectStandardInput = $true
$psi.RedirectStandardOutput = $true
$psi.RedirectStandardError = $true
$psi.CreateNoWindow = $true
$workerProcess = New-Object System.Diagnostics.Process
$workerProcess.StartInfo = $psi
if (-not $workerProcess.Start()) {
throw "Failed to start worker process."
}
Write-ControllerLog "Worker process started with PID $($workerProcess.Id)"
Write-Metadata -Status 'running' -WorkerPid $workerProcess.Id -ControllerPid $controllerPid -Restarts $restartCount
# Check if process exited immediately
if ($workerProcess.HasExited) {
$exitCode = -1
try {
$exitCode = $workerProcess.ExitCode
}
catch {
Write-ControllerLog "Unable to read immediate exit code: $($_.Exception.Message)"
}
Write-ControllerLog "Worker process exited immediately after start with code $exitCode"
Write-Metadata -Status 'stopped' -WorkerPid $null -ControllerPid $controllerPid -Restarts $restartCount -LastExitCode $exitCode
if ($exitCode -eq 0) { break }
# Continue to restart logic below
}
else {
$stdoutHandler = [UnifiedWorkers.ProcessLogHandler]::new($logWriter, 'OUT')
$stderrHandler = [UnifiedWorkers.ProcessLogHandler]::new($logWriter, 'ERR')
$outputHandler = [System.Diagnostics.DataReceivedEventHandler]$stdoutHandler.OnDataReceived
$errorHandler = [System.Diagnostics.DataReceivedEventHandler]$stderrHandler.OnDataReceived
$workerProcess.add_OutputDataReceived($outputHandler)
$workerProcess.add_ErrorDataReceived($errorHandler)
$workerProcess.BeginOutputReadLine()
$workerProcess.BeginErrorReadLine()
Write-ControllerLog "Output handlers set up successfully"
# Give process a moment to start, then check again
Start-Sleep -Milliseconds 200
if ($workerProcess.HasExited) {
$exitCode = -1
try {
$exitCode = $workerProcess.ExitCode
}
catch {
Write-ControllerLog "Unable to read exit code after delay: $($_.Exception.Message)"
}
Write-ControllerLog "Worker process exited after 200ms delay with code $exitCode"
Write-Metadata -Status 'stopped' -WorkerPid $null -ControllerPid $controllerPid -Restarts $restartCount -LastExitCode $exitCode
if ($exitCode -eq 0) { break }
# Continue to restart logic below
}
else {
Write-ControllerLog "Worker process is running, entering monitoring loop"
while (-not $workerProcess.HasExited) {
$commands = Get-PendingCommands
foreach ($command in $commands) {
$trimmed = $command.Trim()
if (-not $trimmed) { continue }
Write-ControllerLog "Received command '$trimmed'"
try {
$workerProcess.StandardInput.WriteLine($trimmed)
$workerProcess.StandardInput.Flush()
}
catch {
Write-ControllerLog "Failed to forward command '$trimmed': $($_.Exception.Message)"
}
if ($trimmed -ieq 'quit') {
Write-ControllerLog "Quit command issued. Waiting for worker to exit."
}
}
Start-Sleep -Milliseconds 500
}
# End of monitoring loop - process has exited
Write-ControllerLog "Worker process exited, exiting monitoring loop"
}
}
# Wait for process to fully exit before reading exit code
$workerProcess.WaitForExit(1000)
$exitCode = -1
try {
$exitCode = $workerProcess.ExitCode
}
catch {
Write-ControllerLog "Unable to read worker exit code: $($_.Exception.Message)"
}
Write-ControllerLog "Worker exited with code $exitCode"
Write-Metadata -Status 'stopped' -WorkerPid $null -ControllerPid $controllerPid -Restarts $restartCount -LastExitCode $exitCode
if ($exitCode -eq 0) {
break
}
}
catch {
Write-ControllerLog "Controller error: $($_.Exception.Message)"
}
$restartCount++
if ($restartCount -gt $MaxRestarts) {
Write-ControllerLog "Maximum restart attempts reached. Controller stopping."
break
}
Write-ControllerLog "Restarting worker in $RestartDelaySeconds seconds (attempt $restartCount of $MaxRestarts)."
Start-Sleep -Seconds $RestartDelaySeconds
}
Write-Metadata -Status 'inactive' -WorkerPid $null -ControllerPid $controllerPid -Restarts $restartCount
Write-ControllerLog "Controller exiting."
}
catch {
Write-FatalLog "Fatal controller error: $($_.Exception.Message)"
if ($_.ScriptStackTrace) {
Write-FatalLog "Stack: $($_.ScriptStackTrace)"
}
throw
}
finally {
if ($logWriter) {
$logWriter.Dispose()
}
if ($logStream) {
$logStream.Dispose()
}
}

View File

@@ -50,6 +50,372 @@ $workers = @(
}
)
$script:ControllerScriptBase64 = $null
$script:AttachHelperScriptBase64 = $null
$script:WorkerBasePathCache = @{}
function Build-SshArgsFromParts {
param(
[pscustomobject]$Parts,
[switch]$Interactive
)
$args = @('-o','ServerAliveInterval=60','-o','ServerAliveCountMax=30')
if ($Interactive -and $Parts.RequestPty) {
$args += '-t'
}
elseif (-not $Interactive) {
$args += '-T'
}
$args += $Parts.Options
if ($Parts.Port) {
$args += '-p'
$args += $Parts.Port
}
$args += $Parts.Host
return $args
}
function Build-ScpArgsFromParts {
param(
[pscustomobject]$Parts
)
$args = @('-o','ServerAliveInterval=60','-o','ServerAliveCountMax=30')
$args += $Parts.Options
if ($Parts.Port) {
$args += '-P'
$args += $Parts.Port
}
return $args
}
function Get-SshArgs {
param(
[object]$Worker,
[switch]$Interactive
)
$parts = Get-WorkerConnectionParts -RawArgs $Worker.SSHArgs -DefaultHost $Worker.Name
return Build-SshArgsFromParts -Parts $parts -Interactive:$Interactive
}
function Get-WorkerBasePath {
param(
[object]$Worker,
[pscustomobject]$ConnectionParts = $null
)
if ($script:WorkerBasePathCache.ContainsKey($Worker.Name)) {
return $script:WorkerBasePathCache[$Worker.Name]
}
if (-not $ConnectionParts) {
$ConnectionParts = Get-WorkerConnectionParts -RawArgs $Worker.SSHArgs -DefaultHost $Worker.Name
}
$sshArgs = Build-SshArgsFromParts -Parts $ConnectionParts -Interactive:$false
$scriptBlock = "`$ProgressPreference='SilentlyContinue'; [Environment]::GetFolderPath('LocalApplicationData')"
$encoded = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($scriptBlock))
$remoteCmd = "powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -EncodedCommand $encoded"
$output = & ssh @sshArgs $remoteCmd
if ($LASTEXITCODE -ne 0) {
throw "Unable to determine LocalAppData on $($Worker.Name)."
}
$base = ($output | Where-Object { -not [string]::IsNullOrWhiteSpace($_) } | Select-Object -Last 1).Trim()
if (-not $base) {
throw "Unable to read LocalAppData path on $($Worker.Name)."
}
$final = Join-Path $base 'UnifiedWorkers'
$script:WorkerBasePathCache[$Worker.Name] = $final
return $final
}
function Get-FileBase64 {
param([string]$Path)
[Convert]::ToBase64String([IO.File]::ReadAllBytes($Path))
}
function Get-ControllerScriptBase64 {
if (-not $script:ControllerScriptBase64) {
$controllerPath = Join-Path $PSScriptRoot 'remote_worker_controller.ps1'
$script:ControllerScriptBase64 = Get-FileBase64 -Path $controllerPath
}
return $script:ControllerScriptBase64
}
function Get-AttachHelperScriptBase64 {
if (-not $script:AttachHelperScriptBase64) {
$helperPath = Join-Path $PSScriptRoot 'remote_worker_attach.ps1'
$script:AttachHelperScriptBase64 = Get-FileBase64 -Path $helperPath
}
return $script:AttachHelperScriptBase64
}
function ConvertTo-Base64Unicode {
param([string]$Content)
[Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($Content))
}
function Get-WorkerSshArgs {
param([string]$RawArgs)
if ([string]::IsNullOrWhiteSpace($RawArgs)) {
return @()
}
return $RawArgs -split '\s+' | Where-Object { $_.Trim().Length -gt 0 }
}
function Get-WorkerConnectionParts {
param(
[string]$RawArgs,
[string]$DefaultHost
)
$tokens = Get-WorkerSshArgs -RawArgs $RawArgs
$options = New-Object System.Collections.Generic.List[string]
$targetHost = $null
$port = $null
$requestPty = $false
$optionsWithArgs = @('-i','-o','-c','-D','-E','-F','-I','-J','-L','-l','-m','-O','-Q','-R','-S','-W','-w')
for ($i = 0; $i -lt $tokens.Count; $i++) {
$token = $tokens[$i]
if ($token -eq '-t' -or $token -eq '-tt') {
$requestPty = $true
continue
}
if ($token -eq '-p' -and ($i + 1) -lt $tokens.Count) {
$port = $tokens[$i + 1]
$i++
continue
}
if ($token.StartsWith('-')) {
$options.Add($token)
if ($optionsWithArgs -contains $token -and ($i + 1) -lt $tokens.Count) {
$options.Add($tokens[$i + 1])
$i++
}
continue
}
if (-not $targetHost) {
$targetHost = $token
continue
}
$options.Add($token)
}
if (-not $targetHost) {
$targetHost = $DefaultHost
}
return [pscustomobject]@{
Host = $targetHost
Options = $options.ToArray()
Port = $port
RequestPty = $requestPty
}
}
function Invoke-RemotePowerShell {
param(
[Parameter(Mandatory = $true)][object]$Worker,
[Parameter(Mandatory = $true)][string]$Script,
[switch]$Interactive
)
$parts = Get-WorkerConnectionParts -RawArgs $Worker.SSHArgs -DefaultHost $Worker.Name
if (-not $parts.Host) {
throw "Unable to determine SSH host for $($Worker.Name)"
}
$sshBaseArgs = Build-SshArgsFromParts -Parts $parts -Interactive:$Interactive
$remoteBasePath = Get-WorkerBasePath -Worker $Worker -ConnectionParts $parts
$localTemp = [System.IO.Path]::GetTempFileName() + '.ps1'
Set-Content -Path $localTemp -Value $Script -Encoding UTF8
$remoteTmpDir = Join-Path $remoteBasePath 'tmp'
$remoteScriptWin = Join-Path $remoteTmpDir ("script-{0}.ps1" -f ([guid]::NewGuid().ToString()))
$remoteScriptScp = $remoteScriptWin -replace '\\','/'
$remoteTarget = "{0}:{1}" -f $parts.Host, ('"'+$remoteScriptScp+'"')
$ensureScript = "New-Item -ItemType Directory -Path '$remoteTmpDir' -Force | Out-Null"
$ensureCmd = "powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -EncodedCommand " + [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($ensureScript))
& ssh @sshBaseArgs $ensureCmd
if ($LASTEXITCODE -ne 0) {
Remove-Item $localTemp -ErrorAction SilentlyContinue
return $LASTEXITCODE
}
$scpArgs = Build-ScpArgsFromParts -Parts $parts
$scpArgs += $localTemp
$scpArgs += $remoteTarget
& scp @scpArgs
$scpExit = $LASTEXITCODE
Remove-Item $localTemp -ErrorAction SilentlyContinue
if ($scpExit -ne 0) {
return $scpExit
}
$execCmd = "powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -File `"$remoteScriptWin`""
& ssh @sshBaseArgs $execCmd
$execExit = $LASTEXITCODE
$cleanupScript = "Remove-Item -LiteralPath '$remoteScriptWin' -ErrorAction SilentlyContinue"
$cleanupCmd = "powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -EncodedCommand " + [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($cleanupScript))
& ssh @sshBaseArgs $cleanupCmd | Out-Null
return $execExit
}
function Ensure-ControllerDeployed {
param([object]$Worker)
$controllerBase64 = Get-ControllerScriptBase64
$script = @"
`$ProgressPreference = 'SilentlyContinue'
`$dataRoot = Join-Path ([Environment]::GetFolderPath('LocalApplicationData')) 'UnifiedWorkers'
New-Item -ItemType Directory -Path `$dataRoot -Force | Out-Null
`$controllerPath = Join-Path `$dataRoot 'controller.ps1'
[IO.File]::WriteAllBytes(`$controllerPath, [Convert]::FromBase64String('$controllerBase64'))
"@
Invoke-RemotePowerShell -Worker $Worker -Script $script | Out-Null
}
function Ensure-AttachHelperDeployed {
param([object]$Worker)
$helperBase64 = Get-AttachHelperScriptBase64
$script = @"
`$ProgressPreference = 'SilentlyContinue'
`$dataRoot = Join-Path ([Environment]::GetFolderPath('LocalApplicationData')) 'UnifiedWorkers'
New-Item -ItemType Directory -Path `$dataRoot -Force | Out-Null
`$attachPath = Join-Path `$dataRoot 'attach-helper.ps1'
[IO.File]::WriteAllBytes(`$attachPath, [Convert]::FromBase64String('$helperBase64'))
"@
Invoke-RemotePowerShell -Worker $Worker -Script $script | Out-Null
}
function Get-EnsureWorkerScript {
param(
[string]$WorkerName,
[string]$WorkerType,
[string]$PayloadBase64
)
$payload = @{
WorkerName = $WorkerName
WorkerType = $WorkerType
PayloadBase64 = $PayloadBase64
} | ConvertTo-Json -Compress
$payloadBase64 = ConvertTo-Base64Unicode -Content $payload
return @"
`$ProgressPreference = 'SilentlyContinue'
`$params = ConvertFrom-Json ([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('$payloadBase64')))
`$workerName = `$params.WorkerName
`$workerType = `$params.WorkerType
`$payloadBase64 = `$params.PayloadBase64
`$dataRoot = Join-Path ([Environment]::GetFolderPath('LocalApplicationData')) 'UnifiedWorkers'
`$instanceRoot = Join-Path (Join-Path `$dataRoot `$workerType) `$workerName
`$metaPath = Join-Path `$instanceRoot 'state\worker-info.json'
`$controllerPath = Join-Path `$dataRoot 'controller.ps1'
if (-not (Test-Path `$controllerPath)) {
throw "Controller missing at `$controllerPath"
}
`$shouldStart = `$true
if (Test-Path `$metaPath) {
try {
`$meta = Get-Content `$metaPath -Raw | ConvertFrom-Json
if (`$meta.Status -eq 'running' -and `$meta.WorkerPid) {
if (Get-Process -Id `$meta.WorkerPid -ErrorAction SilentlyContinue) {
Write-Host "Worker `$workerName already running (PID `$($meta.WorkerPid))."
`$shouldStart = `$false
}
}
} catch {
Write-Host "Unable to parse metadata for `$workerName. Starting new controller." -ForegroundColor Yellow
}
}
if (`$shouldStart) {
`$pwsh = Get-Command pwsh -ErrorAction SilentlyContinue
if (`$pwsh) {
`$psExe = `$pwsh.Source
}
else {
`$psExe = (Get-Command powershell -ErrorAction Stop).Source
}
`$controllerArgs = @(
'-NoLogo','-NoProfile','-ExecutionPolicy','Bypass',
'-File',"`$controllerPath",
'-WorkerName',"`$workerName",
'-WorkerType',"`$workerType",
'-PayloadBase64',"`$payloadBase64"
)
Start-Process -FilePath `$psExe -ArgumentList `$controllerArgs -WindowStyle Hidden | Out-Null
Write-Host "Worker `$workerName started under controller." -ForegroundColor Green
}
"@
}
function Ensure-PersistentWorker {
param(
[object]$Worker,
[string]$WorkerType,
[string]$PayloadScript
)
Write-Host "[$($Worker.Name)] Ensuring worker is running under controller..." -ForegroundColor Cyan
Ensure-ControllerDeployed -Worker $Worker
$payloadBase64 = ConvertTo-Base64Unicode -Content $PayloadScript
$ensureScript = Get-EnsureWorkerScript -WorkerName $Worker.Name -WorkerType $WorkerType -PayloadBase64 $payloadBase64
$result = Invoke-RemotePowerShell -Worker $Worker -Script $ensureScript
if ($result -ne 0) {
Write-Host "[$($Worker.Name)] Remote ensure command exited with code $result." -ForegroundColor Yellow
}
}
function Invoke-WorkerAttach {
param(
[object]$Worker,
[string]$WorkerType,
[switch]$CommandOnly,
[string]$Command
)
Ensure-AttachHelperDeployed -Worker $Worker
$paramsBlock = @("-WorkerName","$($Worker.Name)","-WorkerType","$WorkerType")
if ($CommandOnly) {
$paramsBlock += "-CommandOnly"
}
if ($Command) {
$paramsBlock += "-Command"
$paramsBlock += $Command
}
$parts = Get-WorkerConnectionParts -RawArgs $Worker.SSHArgs -DefaultHost $Worker.Name
$sshArgs = Build-SshArgsFromParts -Parts $parts -Interactive:(!$CommandOnly)
$remoteBasePath = Get-WorkerBasePath -Worker $Worker -ConnectionParts $parts
$remoteHelper = Join-Path $remoteBasePath 'attach-helper.ps1'
$quotedArgs = ($paramsBlock | ForEach-Object { '"' + ($_ -replace '"','""') + '"' }) -join ' '
$remoteCmd = "powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -File `"$remoteHelper`" $quotedArgs"
& ssh @sshArgs $remoteCmd
}
# FUNCTIONS
# This function generates the standard PowerShell remote command
@@ -258,57 +624,10 @@ function Start-StandardWorker {
[Parameter(Mandatory = $true)]
[object]$Worker
)
$retryCount = 0
$retryDelay = 15 # seconds between retries
$workerRestarted = $false
while ($true) { # Changed to infinite loop
if ($retryCount -gt 0) {
Write-Host "`nRestarting worker process (Attempt $($retryCount + 1))..." -ForegroundColor Yellow
Start-Sleep -Seconds $retryDelay
$workerRestarted = $true
}
Write-Host "Connecting to $($Worker.Name)..." -ForegroundColor Cyan
if ($workerRestarted) {
Write-Host "Worker was restarted due to disconnection or crash." -ForegroundColor Yellow
}
try {
$remoteCommand = Get-RemoteStandardWorkerCommand
# Encode the command to handle special characters
$bytes = [System.Text.Encoding]::Unicode.GetBytes($remoteCommand)
$encodedCommand = [Convert]::ToBase64String($bytes)
# Execute the encoded command on the remote machine
Write-Host "Connecting to $($Worker.Name) and executing worker script..." -ForegroundColor Yellow
# Add SSH keepalive settings to reduce chance of random disconnections
$sshCommand = "ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=30 $($Worker.SSHArgs) ""powershell -EncodedCommand $encodedCommand"""
# Execute the SSH command and capture the exit code
Invoke-Expression $sshCommand
$sshExitCode = $LASTEXITCODE
# Check if SSH command completed successfully
if ($sshExitCode -eq 0) {
Write-Host "`nWorker completed successfully. Restarting automatically..." -ForegroundColor Green
Start-Sleep -Seconds 2 # Brief pause before restarting
$retryCount = 0 # Reset counter for successful completion
continue # Continue the loop instead of breaking
} else {
throw "Worker process exited with code: $sshExitCode"
}
}
catch {
$retryCount++
Write-Host "`nAn error occurred while running worker on $($Worker.Name):" -ForegroundColor Red
Write-Host $_.Exception.Message -ForegroundColor Red
Write-Host "`nAttempting to restart worker in $retryDelay seconds..." -ForegroundColor Yellow
}
}
$payloadScript = Get-RemoteStandardWorkerCommand
Ensure-PersistentWorker -Worker $Worker -WorkerType 'flamenco' -PayloadScript $payloadScript
Invoke-WorkerAttach -Worker $Worker -WorkerType 'flamenco'
}
# This function launches the CMD worker
@@ -317,57 +636,10 @@ function Start-CmdWorker {
[Parameter(Mandatory = $true)]
[object]$Worker
)
$retryCount = 0
$retryDelay = 5 # seconds between retries
$workerRestarted = $false
while ($true) { # Changed to infinite loop
if ($retryCount -gt 0) {
Write-Host "`nRestarting worker process (Attempt $($retryCount + 1))..." -ForegroundColor Yellow
Start-Sleep -Seconds $retryDelay
$workerRestarted = $true
}
Write-Host "Connecting to $($Worker.Name) (CMD mode)..." -ForegroundColor Cyan
if ($workerRestarted) {
Write-Host "Worker was restarted due to disconnection or crash." -ForegroundColor Yellow
}
try {
$remoteCommand = Get-RemoteCmdWorkerCommand
# Encode the command to handle special characters
$bytes = [System.Text.Encoding]::Unicode.GetBytes($remoteCommand)
$encodedCommand = [Convert]::ToBase64String($bytes)
# Execute the encoded command on the remote machine
Write-Host "Connecting to $($Worker.Name) and executing CMD worker script..." -ForegroundColor Yellow
# Add SSH keepalive settings to reduce chance of random disconnections
$sshCommand = "ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=30 $($Worker.SSHArgs) ""powershell -EncodedCommand $encodedCommand"""
# Execute the SSH command and capture the exit code
Invoke-Expression $sshCommand
$sshExitCode = $LASTEXITCODE
# Check if SSH command completed successfully
if ($sshExitCode -eq 0) {
Write-Host "`nWorker completed successfully. Restarting automatically..." -ForegroundColor Green
Start-Sleep -Seconds 2 # Brief pause before restarting
$retryCount = 0 # Reset counter for successful completion
continue # Continue the loop instead of breaking
} else {
throw "Worker process exited with code: $sshExitCode"
}
}
catch {
$retryCount++
Write-Host "`nAn error occurred while running worker on $($Worker.Name):" -ForegroundColor Red
Write-Host $_.Exception.Message -ForegroundColor Red
Write-Host "`nAttempting to restart worker in $retryDelay seconds..." -ForegroundColor Yellow
}
}
$payloadScript = Get-RemoteCmdWorkerCommand
Ensure-PersistentWorker -Worker $Worker -WorkerType 'flamenco' -PayloadScript $payloadScript
Invoke-WorkerAttach -Worker $Worker -WorkerType 'flamenco'
}
# This function launches ALL workers in Windows Terminal tabs
@@ -376,174 +648,22 @@ function Start-AllWorkers {
[Parameter(Mandatory = $true)]
[string]$WorkerType
)
Write-Host "Launching ALL $WorkerType workers in Windows Terminal tabs..." -ForegroundColor Cyan
try {
# First, check if Windows Terminal is available
if (-not (Get-Command wt.exe -ErrorAction SilentlyContinue)) {
Write-Host "Windows Terminal (wt.exe) not found. Falling back to separate windows." -ForegroundColor Yellow
$useTerminal = $false
} else {
$useTerminal = $true
}
foreach ($worker in $workers) {
# Create a new PowerShell script with a unique name for this worker
$tempScriptPath = [System.IO.Path]::GetTempFileName() + ".ps1"
# Create different script content based on worker type
if ($WorkerType -eq "CMD") {
# CMD workers get retry logic at the local level
$scriptContent = @"
# Wrap everything in a try-catch to prevent script termination
try {
Write-Host 'Launching $WorkerType worker for $($worker.Name)' -ForegroundColor Cyan
Write-Host "Ensuring ALL $WorkerType workers are running under controllers..." -ForegroundColor Cyan
`$retryCount = 0
`$retryDelay = 5 # seconds between retries
`$workerRestarted = `$false
while (`$true) { # Changed to infinite loop
try {
if (`$retryCount -gt 0) {
Write-Host "`nRestarting worker process (Attempt `$(`$retryCount + 1))..." -ForegroundColor Yellow
Start-Sleep -Seconds `$retryDelay
`$workerRestarted = `$true
}
Write-Host "Connecting to $($worker.Name) ($WorkerType mode)..." -ForegroundColor Cyan
if (`$workerRestarted) {
Write-Host "Worker was restarted due to disconnection or crash." -ForegroundColor Yellow
}
# Get remote command
`$remoteCommand = @'
$(Get-RemoteSimplifiedCmdWorkerCommand)
'@
# Encode the command
`$bytes = [System.Text.Encoding]::Unicode.GetBytes(`$remoteCommand)
`$encodedCommand = [Convert]::ToBase64String(`$bytes)
# Execute SSH command with keepalive settings and capture exit code
ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=30 $($worker.SSHArgs) "powershell -EncodedCommand `$encodedCommand"
`$sshExitCode = `$LASTEXITCODE
# Check if SSH command completed successfully
if (`$sshExitCode -eq 0) {
Write-Host "`nWorker completed successfully. Restarting automatically..." -ForegroundColor Green
Start-Sleep -Seconds 2 # Brief pause before restarting
`$retryCount = 0 # Reset counter for successful completion
continue # Continue the loop instead of breaking
} else {
throw "SSH command failed with exit code: `$sshExitCode"
}
}
catch {
`$retryCount++
Write-Host "An error occurred while connecting to $($worker.Name):" -ForegroundColor Red
Write-Host `$_.Exception.Message -ForegroundColor Red
Write-Host "Attempting to reconnect in `$retryDelay seconds..." -ForegroundColor Yellow
# Don't rethrow - we want to continue the retry loop
}
$payloadScript = if ($WorkerType -eq 'CMD') {
Get-RemoteCmdWorkerCommand
} else {
Get-RemoteStandardWorkerCommand
}
}
catch {
# This outer catch block is for any unexpected errors that might terminate the script
Write-Host "`nCRITICAL ERROR: Script encountered an unexpected error:" -ForegroundColor Red
Write-Host `$_.Exception.Message -ForegroundColor Red
Write-Host "`nRestarting the entire worker process in 5 seconds..." -ForegroundColor Yellow
Start-Sleep -Seconds 5
# Restart the script by calling itself
& `$MyInvocation.MyCommand.Path
}
"@
} else {
# Standard workers keep the original retry logic
$scriptContent = @"
# Wrap everything in a try-catch to prevent script termination
try {
Write-Host 'Launching $WorkerType worker for $($worker.Name)' -ForegroundColor Cyan
`$retryCount = 0
`$retryDelay = 5 # seconds between retries
while (`$true) { # Changed to infinite loop
try {
if (`$retryCount -gt 0) {
Write-Host "Retry attempt `$retryCount..." -ForegroundColor Yellow
Start-Sleep -Seconds `$retryDelay
}
# Get remote command
`$remoteCommand = @'
$(Get-RemoteStandardWorkerCommand)
'@
# Encode the command
`$bytes = [System.Text.Encoding]::Unicode.GetBytes(`$remoteCommand)
`$encodedCommand = [Convert]::ToBase64String(`$bytes)
# Execute SSH command with keepalive settings
ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=30 $($worker.SSHArgs) "powershell -EncodedCommand `$encodedCommand"
`$sshExitCode = `$LASTEXITCODE
# Check SSH exit code and handle accordingly
if (`$sshExitCode -eq 0) {
Write-Host "`nWorker completed successfully. Restarting automatically..." -ForegroundColor Green
Start-Sleep -Seconds 2 # Brief pause before restarting
`$retryCount = 0 # Reset counter for successful completion
continue # Continue the loop instead of breaking
} else {
throw "SSH command failed with exit code: `$sshExitCode"
}
}
catch {
`$retryCount++
Write-Host "An error occurred while connecting to $($worker.Name):" -ForegroundColor Red
Write-Host `$_.Exception.Message -ForegroundColor Red
Write-Host "Attempting to reconnect in `$retryDelay seconds..." -ForegroundColor Yellow
# Don't rethrow - we want to continue the retry loop
}
foreach ($worker in $workers) {
Ensure-PersistentWorker -Worker $worker -WorkerType 'flamenco' -PayloadScript $payloadScript
}
}
catch {
# This outer catch block is for any unexpected errors that might terminate the script
Write-Host "`nCRITICAL ERROR: Script encountered an unexpected error:" -ForegroundColor Red
Write-Host `$_.Exception.Message -ForegroundColor Red
Write-Host "`nRestarting the entire worker process in 5 seconds..." -ForegroundColor Yellow
Start-Sleep -Seconds 5
# Restart the script by calling itself
& `$MyInvocation.MyCommand.Path
}
"@
}
# Write the script to file
Set-Content -Path $tempScriptPath -Value $scriptContent
if ($useTerminal) {
# Launch in a new Windows Terminal tab
$tabTitle = "$($worker.Name) - $WorkerType Worker"
Start-Process wt.exe -ArgumentList "-w 0 new-tab --title `"$tabTitle`" powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -File `"$tempScriptPath`""
} else {
# Fallback to separate window if Windows Terminal is not available
Start-Process powershell -ArgumentList "-NoLogo -NoProfile -ExecutionPolicy Bypass -File `"$tempScriptPath`""
}
Write-Host "Started $($worker.Name) ($WorkerType) worker in a new tab." -ForegroundColor Green
Start-Sleep -Milliseconds 300 # Small delay between launches
}
Write-Host "`nAll $WorkerType worker scripts have been launched in Windows Terminal tabs." -ForegroundColor Cyan
}
catch {
Write-Host "Error launching workers: $($_.Exception.Message)" -ForegroundColor Red
}
Write-Host "All workers processed. Attach to any worker from the menu to monitor output." -ForegroundColor Green
Write-Host "Press Enter to return to the menu..." -ForegroundColor Green
Read-Host
Read-Host | Out-Null
}
# Main menu loop

View File

@@ -32,6 +32,531 @@ $workers = @(
@{ ID = 6; Name = "i9-13ks"; SSHArgs = "-t -p 22146 i9-13ks"; Enabled = $true }
)
$script:ControllerScriptBase64 = $null
$script:AttachHelperScriptBase64 = $null
$script:WorkerBasePathCache = @{}
function Remove-ClixmlNoise {
param([object[]]$Lines)
$noisePatterns = @(
'^#<\s*CLIXML',
'^\s*<Objs\b', '^\s*</Objs>',
'^\s*<Obj\b', '^\s*</Obj>',
'^\s*<TN\b', '^\s*</TN>',
'^\s*<MS\b', '^\s*</MS>',
'^\s*<PR\b', '^\s*</PR>',
'^\s*<I64\b', '^\s*</I64>',
'^\s*<AI\b', '^\s*</AI>',
'^\s*<Nil\b', '^\s*</Nil>',
'^\s*<PI\b', '^\s*</PI>',
'^\s*<PC\b', '^\s*</PC>',
'^\s*<SR\b', '^\s*</SR>',
'^\s*<SD\b', '^\s*</SD>',
'^\s*<S\b', '^\s*</S>'
)
$filtered = @()
foreach ($entry in $Lines) {
if ($null -eq $entry) { continue }
$text = $entry.ToString()
$isNoise = $false
foreach ($pattern in $noisePatterns) {
if ($text -match $pattern) {
$isNoise = $true
break
}
}
if (-not $isNoise) {
$filtered += $text
}
}
return $filtered
}
function Write-FilteredSshOutput {
param([object[]]$Lines)
$clean = Remove-ClixmlNoise -Lines $Lines
foreach ($line in $clean) {
Write-Host $line
}
}
function Build-SshArgsFromParts {
param(
[pscustomobject]$Parts,
[switch]$Interactive
)
$args = @('-o','ServerAliveInterval=60','-o','ServerAliveCountMax=30')
if ($Interactive -and $Parts.RequestPty) {
$args += '-t'
}
elseif (-not $Interactive) {
$args += '-T'
}
$args += $Parts.Options
if ($Parts.Port) {
$args += '-p'
$args += $Parts.Port
}
$args += $Parts.Host
return $args
}
function Build-ScpArgsFromParts {
param(
[pscustomobject]$Parts
)
$args = @('-o','ServerAliveInterval=60','-o','ServerAliveCountMax=30')
$args += $Parts.Options
if ($Parts.Port) {
$args += '-P'
$args += $Parts.Port
}
return $args
}
function Get-SshArgs {
param(
[object]$Worker,
[switch]$Interactive
)
$parts = Get-WorkerConnectionParts -RawArgs $Worker.SSHArgs -DefaultHost $Worker.Name
return Build-SshArgsFromParts -Parts $parts -Interactive:$Interactive
}
function Get-WorkerBasePath {
param(
[object]$Worker,
[pscustomobject]$ConnectionParts = $null
)
if ($script:WorkerBasePathCache.ContainsKey($Worker.Name)) {
return $script:WorkerBasePathCache[$Worker.Name]
}
if (-not $ConnectionParts) {
$ConnectionParts = Get-WorkerConnectionParts -RawArgs $Worker.SSHArgs -DefaultHost $Worker.Name
}
$sshArgs = Build-SshArgsFromParts -Parts $ConnectionParts -Interactive:$false
$scriptBlock = "`$ProgressPreference='SilentlyContinue'; [Environment]::GetFolderPath('LocalApplicationData')"
$encoded = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($scriptBlock))
$remoteCmd = "powershell -NoLogo -NoProfile -NonInteractive -OutputFormat Text -ExecutionPolicy Bypass -EncodedCommand $encoded"
$rawOutput = & ssh @sshArgs $remoteCmd 2>&1
$output = Remove-ClixmlNoise -Lines $rawOutput
if ($LASTEXITCODE -ne 0) {
throw "Unable to determine LocalAppData on $($Worker.Name)."
}
$base = ($output | Where-Object { -not [string]::IsNullOrWhiteSpace($_) } | Select-Object -Last 1).Trim()
if (-not $base) {
throw "Unable to read LocalAppData path on $($Worker.Name)."
}
$final = Join-Path $base 'UnifiedWorkers'
$script:WorkerBasePathCache[$Worker.Name] = $final
return $final
}
function Get-FileBase64 {
param([string]$Path)
[Convert]::ToBase64String([IO.File]::ReadAllBytes($Path))
}
function Get-ControllerScriptBase64 {
if (-not $script:ControllerScriptBase64) {
$controllerPath = Join-Path $PSScriptRoot 'remote_worker_controller.ps1'
$script:ControllerScriptBase64 = Get-FileBase64 -Path $controllerPath
}
return $script:ControllerScriptBase64
}
function Get-AttachHelperScriptBase64 {
if (-not $script:AttachHelperScriptBase64) {
$helperPath = Join-Path $PSScriptRoot 'remote_worker_attach.ps1'
$script:AttachHelperScriptBase64 = Get-FileBase64 -Path $helperPath
}
return $script:AttachHelperScriptBase64
}
function ConvertTo-Base64Unicode {
param([string]$Content)
[Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($Content))
}
function Get-WorkerSshArgs {
param([string]$RawArgs)
if ([string]::IsNullOrWhiteSpace($RawArgs)) {
return @()
}
return $RawArgs -split '\s+' | Where-Object { $_.Trim().Length -gt 0 }
}
function Get-WorkerConnectionParts {
param(
[string]$RawArgs,
[string]$DefaultHost
)
$tokens = Get-WorkerSshArgs -RawArgs $RawArgs
$options = New-Object System.Collections.Generic.List[string]
$targetHost = $null
$port = $null
$requestPty = $false
$optionsWithArgs = @('-i','-o','-c','-D','-E','-F','-I','-J','-L','-l','-m','-O','-Q','-R','-S','-W','-w')
for ($i = 0; $i -lt $tokens.Count; $i++) {
$token = $tokens[$i]
if ($token -eq '-t' -or $token -eq '-tt') {
$requestPty = $true
continue
}
if ($token -eq '-p' -and ($i + 1) -lt $tokens.Count) {
$port = $tokens[$i + 1]
$i++
continue
}
if ($token.StartsWith('-')) {
$options.Add($token)
if ($optionsWithArgs -contains $token -and ($i + 1) -lt $tokens.Count) {
$options.Add($tokens[$i + 1])
$i++
}
continue
}
if (-not $targetHost) {
$targetHost = $token
continue
}
$options.Add($token)
}
if (-not $targetHost) {
$targetHost = $DefaultHost
}
return [pscustomobject]@{
Host = $targetHost
Options = $options.ToArray()
Port = $port
RequestPty = $requestPty
}
}
function Invoke-RemotePowerShell {
param(
[object]$Worker,
[string]$Script,
[switch]$Interactive
)
$parts = Get-WorkerConnectionParts -RawArgs $Worker.SSHArgs -DefaultHost $Worker.Name
if (-not $parts.Host) {
throw "Unable to determine SSH host for $($Worker.Name)"
}
$sshBaseArgs = Build-SshArgsFromParts -Parts $parts -Interactive:$Interactive
$remoteBasePath = Get-WorkerBasePath -Worker $Worker -ConnectionParts $parts
$localTemp = [System.IO.Path]::GetTempFileName() + '.ps1'
Set-Content -Path $localTemp -Value $Script -Encoding UTF8
$remoteTmpDir = Join-Path $remoteBasePath 'tmp'
$remoteScriptWin = Join-Path $remoteTmpDir ("script-{0}.ps1" -f ([guid]::NewGuid().ToString()))
$remoteScriptScp = $remoteScriptWin -replace '\\','/'
$remoteTarget = "{0}:{1}" -f $parts.Host, ('"'+$remoteScriptScp+'"')
$ensureScript = "New-Item -ItemType Directory -Path '$remoteTmpDir' -Force | Out-Null"
$ensureCmd = "powershell -NoLogo -NoProfile -NonInteractive -OutputFormat Text -ExecutionPolicy Bypass -EncodedCommand " + [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($ensureScript))
$ensureOutput = & ssh @sshBaseArgs $ensureCmd 2>&1
$ensureExit = $LASTEXITCODE
Write-FilteredSshOutput -Lines $ensureOutput
if ($ensureExit -ne 0) {
Remove-Item $localTemp -ErrorAction SilentlyContinue
return $ensureExit
}
$scpArgs = Build-ScpArgsFromParts -Parts $parts
$scpArgs += $localTemp
$scpArgs += $remoteTarget
& scp @scpArgs
$scpExit = $LASTEXITCODE
Remove-Item $localTemp -ErrorAction SilentlyContinue
if ($scpExit -ne 0) {
return $scpExit
}
$execCmd = "powershell -NoLogo -NoProfile -NonInteractive -OutputFormat Text -ExecutionPolicy Bypass -File `"$remoteScriptWin`""
$execOutput = & ssh @sshBaseArgs $execCmd 2>&1
$execExit = $LASTEXITCODE
Write-FilteredSshOutput -Lines $execOutput
$cleanupScript = "Remove-Item -LiteralPath '$remoteScriptWin' -ErrorAction SilentlyContinue"
$cleanupCmd = "powershell -NoLogo -NoProfile -NonInteractive -OutputFormat Text -ExecutionPolicy Bypass -EncodedCommand " + [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($cleanupScript))
$cleanupOutput = & ssh @sshBaseArgs $cleanupCmd 2>&1
Write-FilteredSshOutput -Lines $cleanupOutput
return [int]$execExit
}
function Resolve-ExitCode {
param($Value)
if ($Value -is [System.Array]) {
for ($i = $Value.Count - 1; $i -ge 0; $i--) {
$candidate = Resolve-ExitCode -Value $Value[$i]
if ($candidate -ne $null) {
return $candidate
}
}
return 0
}
if ($Value -is [int]) {
return $Value
}
$text = $Value
if ($null -eq $text) {
return 0
}
$parsed = 0
if ([int]::TryParse($text.ToString(), [ref]$parsed)) {
return $parsed
}
return 0
}
function Ensure-ControllerDeployed {
param([object]$Worker)
$controllerBase64 = Get-ControllerScriptBase64
$script = @"
`$ProgressPreference = 'SilentlyContinue'
`$dataRoot = Join-Path ([Environment]::GetFolderPath('LocalApplicationData')) 'UnifiedWorkers'
New-Item -ItemType Directory -Path `$dataRoot -Force | Out-Null
`$controllerPath = Join-Path `$dataRoot 'controller.ps1'
[IO.File]::WriteAllBytes(`$controllerPath, [Convert]::FromBase64String('$controllerBase64'))
"@
$exit = Resolve-ExitCode (Invoke-RemotePowerShell -Worker $Worker -Script $script)
if ($exit -ne 0) {
throw "Controller deployment failed on $($Worker.Name) (exit $exit)."
}
}
function Ensure-AttachHelperDeployed {
param([object]$Worker)
$helperBase64 = Get-AttachHelperScriptBase64
$script = @"
`$ProgressPreference = 'SilentlyContinue'
`$dataRoot = Join-Path ([Environment]::GetFolderPath('LocalApplicationData')) 'UnifiedWorkers'
New-Item -ItemType Directory -Path `$dataRoot -Force | Out-Null
`$attachPath = Join-Path `$dataRoot 'attach-helper.ps1'
[IO.File]::WriteAllBytes(`$attachPath, [Convert]::FromBase64String('$helperBase64'))
"@
$exit = Resolve-ExitCode (Invoke-RemotePowerShell -Worker $Worker -Script $script)
if ($exit -ne 0) {
throw "Attach helper deployment failed on $($Worker.Name) (exit $exit)."
}
}
function Get-EnsureWorkerScript {
param(
[string]$WorkerName,
[string]$WorkerType,
[string]$PayloadBase64
)
$payload = @{
WorkerName = $WorkerName
WorkerType = $WorkerType
PayloadBase64 = $PayloadBase64
} | ConvertTo-Json -Compress
$payloadBase64 = ConvertTo-Base64Unicode -Content $payload
return @"
`$ProgressPreference = 'SilentlyContinue'
`$params = ConvertFrom-Json ([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('$payloadBase64')))
`$workerName = `$params.WorkerName
`$workerType = `$params.WorkerType
`$payloadBase64 = `$params.PayloadBase64
`$dataRoot = Join-Path ([Environment]::GetFolderPath('LocalApplicationData')) 'UnifiedWorkers'
`$instanceRoot = Join-Path (Join-Path `$dataRoot `$workerType) `$workerName
`$logsRoot = Join-Path `$instanceRoot 'logs'
`$stateRoot = Join-Path `$instanceRoot 'state'
New-Item -ItemType Directory -Path `$logsRoot -Force | Out-Null
New-Item -ItemType Directory -Path `$stateRoot -Force | Out-Null
`$logPath = Join-Path `$logsRoot 'worker.log'
`$commandPath = Join-Path `$stateRoot 'commands.txt'
`$payloadPath = Join-Path `$stateRoot 'payload.ps1'
`$payloadBase64Path = Join-Path `$stateRoot 'payload.b64'
if (-not (Test-Path `$logPath)) { New-Item -Path `$logPath -ItemType File -Force | Out-Null }
if (-not (Test-Path `$commandPath)) { New-Item -Path `$commandPath -ItemType File -Force | Out-Null }
[IO.File]::WriteAllText(`$payloadBase64Path, `$payloadBase64, [System.Text.Encoding]::UTF8)
`$metaPath = Join-Path `$instanceRoot 'state\worker-info.json'
`$controllerPath = Join-Path `$dataRoot 'controller.ps1'
if (-not (Test-Path `$controllerPath)) {
throw "Controller missing at `$controllerPath"
}
`$shouldStart = `$true
if (Test-Path `$metaPath) {
try {
`$meta = Get-Content `$metaPath -Raw | ConvertFrom-Json
if (`$meta.Status -eq 'running' -and `$meta.WorkerPid) {
if (Get-Process -Id `$meta.WorkerPid -ErrorAction SilentlyContinue) {
Write-Host "Worker `$workerName already running (PID `$($meta.WorkerPid))."
`$shouldStart = `$false
}
}
} catch {
Write-Host "Failed to read metadata. Controller will restart worker." -ForegroundColor Yellow
}
}
if (`$shouldStart) {
`$initialMeta = [pscustomobject]@{
WorkerName = `$workerName
WorkerType = `$workerType
Status = 'launching'
ControllerPid = `$null
WorkerPid = `$null
Restarts = 0
LastExitCode = `$null
LogPath = `$logPath
CommandPath = `$commandPath
PayloadPath = `$payloadPath
UpdatedAtUtc = (Get-Date).ToUniversalTime()
} | ConvertTo-Json -Depth 5
`$initialMeta | Set-Content -Path `$metaPath -Encoding UTF8
`$pwsh = Get-Command pwsh -ErrorAction SilentlyContinue
if (`$pwsh) {
`$psExe = `$pwsh.Source
}
else {
`$psExe = (Get-Command powershell -ErrorAction Stop).Source
}
`$controllerArgs = @(
'-NoLogo','-NoProfile','-ExecutionPolicy','Bypass',
'-File',"`$controllerPath",
'-WorkerName',"`$workerName",
'-WorkerType',"`$workerType",
'-PayloadBase64Path',"`$payloadBase64Path"
)
Start-Process -FilePath `$psExe -ArgumentList `$controllerArgs -WindowStyle Hidden | Out-Null
Write-Host "Worker `$workerName started under controller." -ForegroundColor Green
}
"@
}
function Ensure-PersistentWorker {
param(
[object]$Worker,
[string]$WorkerType,
[string]$PayloadScript
)
Ensure-ControllerDeployed -Worker $Worker
$payloadBase64 = ConvertTo-Base64Unicode -Content $PayloadScript
$ensureScript = Get-EnsureWorkerScript -WorkerName $Worker.Name -WorkerType $WorkerType -PayloadBase64 $payloadBase64
$exit = Resolve-ExitCode (Invoke-RemotePowerShell -Worker $Worker -Script $ensureScript)
if ($exit -ne 0) {
throw "Worker ensure script failed on $($Worker.Name) (exit $exit)."
}
}
function Test-WorkerMetadataExists {
param(
[object]$Worker,
[string]$WorkerType
)
$payload = @{
WorkerName = $Worker.Name
WorkerType = $WorkerType
} | ConvertTo-Json -Compress
$payloadBase64 = ConvertTo-Base64Unicode -Content $payload
$script = @"
`$ProgressPreference = 'SilentlyContinue'
`$params = ConvertFrom-Json ([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('$payloadBase64')))
`$dataRoot = Join-Path ([Environment]::GetFolderPath('LocalApplicationData')) 'UnifiedWorkers'
`$instanceRoot = Join-Path (Join-Path `$dataRoot `$params.WorkerType) `$params.WorkerName
`$metaPath = Join-Path `$instanceRoot 'state\worker-info.json'
if (Test-Path `$metaPath) {
exit 0
}
exit 1
"@
$result = Invoke-RemotePowerShell -Worker $Worker -Script $script
return ($result -eq 0)
}
function Wait-WorkerMetadata {
param(
[object]$Worker,
[string]$WorkerType,
[int]$TimeoutSeconds = 30
)
$deadline = [DateTime]::UtcNow.AddSeconds($TimeoutSeconds)
while ([DateTime]::UtcNow -lt $deadline) {
if (Test-WorkerMetadataExists -Worker $Worker -WorkerType $WorkerType) {
return $true
}
Start-Sleep -Milliseconds 500
}
return $false
}
function Invoke-WorkerAttach {
param(
[object]$Worker,
[string]$WorkerType,
[switch]$CommandOnly,
[string]$Command
)
Ensure-AttachHelperDeployed -Worker $Worker
$paramsBlock = @("-WorkerName","$($Worker.Name)","-WorkerType","$WorkerType")
if ($CommandOnly) {
$paramsBlock += "-CommandOnly"
}
if ($Command) {
$paramsBlock += "-Command"
$paramsBlock += $Command
}
$parts = Get-WorkerConnectionParts -RawArgs $Worker.SSHArgs -DefaultHost $Worker.Name
$sshArgs = Build-SshArgsFromParts -Parts $parts -Interactive:(!$CommandOnly)
$remoteBase = Get-WorkerBasePath -Worker $Worker -ConnectionParts $parts
$remoteHelper = Join-Path $remoteBase 'attach-helper.ps1'
$quotedArgs = ($paramsBlock | ForEach-Object { '"' + ($_ -replace '"','""') + '"' }) -join ' '
$remoteCmd = "powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -File `"$remoteHelper`" $quotedArgs"
& ssh @sshArgs $remoteCmd
}
function Get-RemoteSheepItCommand {
param(
[string]$RenderKey,
@@ -44,6 +569,7 @@ function Get-RemoteSheepItCommand {
$urlLiteral = '@(' + (($SheepItJarUrls | ForEach-Object { "'$_'" }) -join ', ') + ')'
@"
`$ProgressPreference = 'SilentlyContinue'
`$ErrorActionPreference = 'Stop'
try {
@@ -135,6 +661,7 @@ try {
throw
}
}
catch {
Write-Host ('Error: {0}' -f `$_.Exception.Message) -ForegroundColor Red
Write-Host ('Stack trace: {0}' -f `$_.ScriptStackTrace) -ForegroundColor DarkRed
@@ -142,128 +669,56 @@ catch {
"@
}
function New-SheepItSessionScript {
param(
[object]$Worker,
[string]$RemoteCommand
)
$rawArgs = @($Worker.SSHArgs -split '\s+' | Where-Object { $_ -and $_.Trim().Length -gt 0 })
$sshArgsJson = if ($rawArgs) { ($rawArgs | ConvertTo-Json -Compress) } else { '[]' }
$targetHost = ($rawArgs | Where-Object { $_ -notmatch '^-{1,2}' } | Select-Object -Last 1)
$hostLiteral = if ($targetHost) { "'" + ($targetHost -replace "'", "''") + "'" } else { '$null' }
$portValue = $null
for ($i = 0; $i -lt $rawArgs.Count; $i++) {
if ($rawArgs[$i] -eq '-p' -and $i -lt ($rawArgs.Count - 1)) {
$portValue = $rawArgs[$i + 1]
break
}
}
$portLiteral = if ($portValue) { "'" + ($portValue -replace "'", "''") + "'" } else { '$null' }
$remoteScriptBase64 = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($RemoteCommand))
$scriptContent = @"
Write-Host 'Connecting to $($Worker.Name)...' -ForegroundColor Cyan
`$sshArgs = ConvertFrom-Json '$sshArgsJson'
`$targetHost = $hostLiteral
`$port = $portLiteral
`$scriptBase64 = '$remoteScriptBase64'
if (-not `$targetHost) {
Write-Host "Unable to determine SSH host for $($Worker.Name)." -ForegroundColor Red
return
}
`$localTemp = [System.IO.Path]::GetTempFileName() + '.ps1'
`$remoteScript = [System.Text.Encoding]::Unicode.GetString([Convert]::FromBase64String(`$scriptBase64))
Set-Content -Path `$localTemp -Value `$remoteScript -Encoding UTF8
`$remoteFile = "sheepit-$([System.Guid]::NewGuid().ToString()).ps1"
`$scpArgs = @('-o','ServerAliveInterval=60','-o','ServerAliveCountMax=30')
if (`$port) {
`$scpArgs += '-P'
`$scpArgs += `$port
}
`$scpArgs += `$localTemp
`$scpArgs += ("${targetHost}:`$remoteFile")
Write-Host "Transferring SheepIt script to `$targetHost..." -ForegroundColor Gray
& scp @scpArgs
if (`$LASTEXITCODE -ne 0) {
Write-Host "Failed to copy script to `$targetHost." -ForegroundColor Red
Remove-Item `$localTemp -ErrorAction SilentlyContinue
return
}
`$sshBase = @('-o','ServerAliveInterval=60','-o','ServerAliveCountMax=30') + `$sshArgs
`$execArgs = `$sshBase + @('powershell','-NoLogo','-NoProfile','-ExecutionPolicy','Bypass','-File',"`$remoteFile")
Write-Host "Starting SheepIt client on `$targetHost..." -ForegroundColor Cyan
& ssh @execArgs
Write-Host "Cleaning up remote script..." -ForegroundColor Gray
`$cleanupArgs = `$sshBase + @('powershell','-NoLogo','-NoProfile','-ExecutionPolicy','Bypass','-Command',"`$ErrorActionPreference='SilentlyContinue'; Remove-Item -LiteralPath ``"$remoteFile``" -ErrorAction SilentlyContinue")
& ssh @cleanupArgs | Out-Null
Remove-Item `$localTemp -ErrorAction SilentlyContinue
Write-Host "`nSSH session ended." -ForegroundColor Yellow
Read-Host "Press Enter to close"
"@
return $scriptContent
}
function Start-SheepItTab {
param(
[string]$Title,
[string]$Content
)
$tempScript = [System.IO.Path]::GetTempFileName() + '.ps1'
Set-Content -Path $tempScript -Value $Content -Encoding UTF8
if (Get-Command wt.exe -ErrorAction SilentlyContinue) {
Start-Process wt.exe -ArgumentList "-w 0 new-tab --title `"$Title`" powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -File `"$tempScript`""
} else {
Start-Process powershell -ArgumentList "-NoLogo -NoProfile -ExecutionPolicy Bypass -File `"$tempScript`""
}
function Ensure-SheepItWorkerController {
param([object]$Worker)
Initialize-SheepItCredentials
$payloadScript = Get-RemoteSheepItCommand -RenderKey $script:SheepItRenderKey -Username $script:SheepItUsername
Ensure-PersistentWorker -Worker $Worker -WorkerType 'sheepit' -PayloadScript $payloadScript
}
function Start-SheepItWorker {
param([object]$Worker)
if (-not $Worker.Enabled) {
Write-Host "$($Worker.Name) is not enabled for SheepIt." -ForegroundColor Yellow
try {
Write-Host "Ensuring SheepIt controller on $($Worker.Name)..." -ForegroundColor Cyan
Ensure-SheepItWorkerController -Worker $Worker
}
catch {
Write-Host "Failed to ensure controller on $($Worker.Name): $($_.Exception.Message)" -ForegroundColor Red
return
}
Initialize-SheepItCredentials
if (-not (Wait-WorkerMetadata -Worker $Worker -WorkerType 'sheepit' -TimeoutSeconds 30)) {
Write-Host "Worker metadata did not appear on $($Worker.Name). Check controller logs under %LocalAppData%\UnifiedWorkers." -ForegroundColor Red
return
}
$remoteCommand = Get-RemoteSheepItCommand -RenderKey $script:SheepItRenderKey -Username $script:SheepItUsername
$sessionScript = New-SheepItSessionScript -Worker $Worker -RemoteCommand $remoteCommand
$title = "$($Worker.Name) - SheepIt"
Start-SheepItTab -Title $title -Content $sessionScript
Write-Host "Opened SheepIt session for $($Worker.Name) in a new terminal tab." -ForegroundColor Green
Write-Host "Controller ready. Attaching to SheepIt worker on $($Worker.Name)..." -ForegroundColor Cyan
Invoke-WorkerAttach -Worker $Worker -WorkerType 'sheepit'
}
function Start-AllSheepIt {
Initialize-SheepItCredentials
$targets = $workers | Where-Object { $_.Enabled }
if (-not $targets) {
Write-Host "No systems are ready for SheepIt." -ForegroundColor Yellow
return
}
foreach ($worker in $targets) {
Start-SheepItWorker -Worker $worker
Start-Sleep -Milliseconds 200
foreach ($worker in $workers | Where-Object { $_.Enabled }) {
Ensure-SheepItWorkerController -Worker $worker
}
Write-Host "All enabled SheepIt workers ensured running under controllers." -ForegroundColor Green
Write-Host "Use the attach option to monitor any worker." -ForegroundColor Cyan
Read-Host "Press Enter to continue" | Out-Null
}
function Send-SheepItCommandAll {
param([string]$CommandText)
foreach ($worker in $workers | Where-Object { $_.Enabled }) {
Write-Host "[$($worker.Name)] Sending '$CommandText'..." -ForegroundColor Gray
Invoke-WorkerAttach -Worker $worker -WorkerType 'sheepit' -CommandOnly -Command $CommandText
}
Write-Host "Command '$CommandText' dispatched to all enabled workers." -ForegroundColor Green
Read-Host "Press Enter to continue" | Out-Null
}
function Select-SheepItWorker {
while ($true) {
Show-Header
@@ -308,20 +763,25 @@ Initialize-SheepItCredentials
while ($true) {
Show-Header
Write-Host "Main Menu:" -ForegroundColor Magenta
Write-Host "1. Launch SheepIt on a single system" -ForegroundColor Yellow
Write-Host "2. Launch SheepIt on all ready systems" -ForegroundColor Yellow
Write-Host "3. Exit" -ForegroundColor Yellow
Write-Host "1. Launch/Attach SheepIt on a single system" -ForegroundColor Yellow
Write-Host "2. Ensure all ready systems are running" -ForegroundColor Yellow
Write-Host "3. Pause all workers" -ForegroundColor Yellow
Write-Host "4. Resume all workers" -ForegroundColor Yellow
Write-Host "5. Quit all workers" -ForegroundColor Yellow
Write-Host "6. Exit" -ForegroundColor Yellow
$choice = Read-Host "Select option (1-3)"
$choice = Read-Host "Select option (1-6)"
if ($choice -eq '6') {
break
}
switch ($choice) {
'1' { Select-SheepItWorker }
'2' {
Start-AllSheepIt
Write-Host
Read-Host "Press Enter to return to the main menu" | Out-Null
}
'3' { break }
'2' { Start-AllSheepIt }
'3' { Send-SheepItCommandAll -CommandText 'pause' }
'4' { Send-SheepItCommandAll -CommandText 'resume' }
'5' { Send-SheepItCommandAll -CommandText 'quit' }
default {
Write-Host "Invalid selection." -ForegroundColor Red
Start-Sleep -Seconds 1

39
workers.json.example Normal file
View File

@@ -0,0 +1,39 @@
{
"workers": [
{
"id": 1,
"name": "i9kf",
"enabled": true,
"ssh": {
"host": "i9kf",
"port": 22,
"args": "-t i9kf"
},
"workerTypes": {
"sheepit": {
"gpu": "OPTIX_0",
"username": "RaincloudTheDragon",
"renderKey": "IfCOWBHFQpceG0601DmyrwOOJOAp2UJAQ0O0X0jF"
},
"flamenco": {
"workerPath": "F:\\software\\Flamenco 3.7",
"networkDrives": ["A:", "F:", "N:", "P:"],
"networkPaths": [
"\\\\NEXUS\\amazon",
"\\\\NEXUS\\flamenco",
"\\\\NEXUS\\proj",
"\\\\NAS\\amazon"
]
}
}
}
],
"globalSettings": {
"sheepitJarUrls": [
"https://www.sheepit-renderfarm.com/media/applet/client-latest.php",
"https://www.sheepit-renderfarm.com/media/applet/client-latest.jar"
]
}
}