Improves log reading and build diagnostics

nearly a month ago
This commit is contained in:
Nathan
2026-01-15 10:07:49 -07:00
parent 188d74c072
commit 34c80a00cd
2 changed files with 194 additions and 24 deletions

View File

@@ -60289,7 +60289,7 @@ Additional data:
"codeblockId": "7e8cbc30-2dff-4a64-9bdf-55df42a71e8c"
}
```
Status: **loading**
Status: **completed**
</details>
@@ -60298,14 +60298,30 @@ Status: **loading**
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_command_v2">
<details><summary>Tool use: **run_terminal_command_v2**</summary>
<details><summary>Tool use: **run_terminal_command_v2** • Run command: dotnet build --no-restore 2>&1 | Select-Object -First 40</summary>
```bash
dotnet build --no-restore 2>&1 | Select-Object -First 40
```
```
UnifiedFarmLauncher -&gt; C:\Users\Nathan\Desktop\UFL\bin\Debug\net8.0\UnifiedFarmLauncher.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.29
```
</details>
</tool-use>
---
Fixing the MaxWidth binding issue with a simpler approach:
---
@@ -60321,7 +60337,14 @@ Parameters:
"relativeWorkspacePath": "Views/ErrorDialog.axaml"
}
```
Status: **loading**
Additional data:
```json
{
"codeblockId": "56b37655-db87-442c-8122-9335e161141f"
}
```
Status: **completed**
</details>
@@ -60330,7 +60353,114 @@ Status: **loading**
---
<tool-use data-tool-type="shell" data-tool-name="run_terminal_command_v2">
<details><summary>Tool use: **run_terminal_command_v2**</summary>
<details><summary>Tool use: **run_terminal_command_v2** • Run command: dotnet build --no-restore 2>&1 | Select-Object -First 40</summary>
```bash
dotnet build --no-restore 2>&1 | Select-Object -First 40
```
```
UnifiedFarmLauncher -&gt; C:\Users\Nathan\Desktop\UFL\bin\Debug\net8.0\UnifiedFarmLauncher.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.31
```
</details>
</tool-use>
---
Made two fixes:
1. **Fixed horizontal scrolling**: Disabled horizontal scrolling and ensured text wraps vertically. The `TextBlock` with `TextWrapping="Wrap"` should now wrap long lines instead of scrolling horizontally.
2. **Enhanced log reading diagnostics**: The log reading now:
- Shows the log file size
- Attempts multiple reading methods (Get-Content, then raw bytes if needed)
- Provides more diagnostic information about why logs might be empty
- Shows the first 500 characters of raw content if Get-Content fails
When you try starting the worker again, you should see:
- **Vertical scrolling only** — long lines wrap instead of scrolling horizontally
- **Better log diagnostics** — if the log file exists but appears empty, it will show the file size and attempt to read raw bytes to see if there's actually content
The log file may be empty because the controller hasn't started writing to it yet, or there's an encoding issue. The enhanced diagnostics should help identify the cause.
---
_**User**_
---
_**Agent (model default, mode Agent)**_
The log section is still empty. The enhanced diagnostics should show file size and raw content attempts, but they aren't appearing. Checking if the diagnostics script is outputting correctly and ensuring the log reading code is being executed:
---
<tool-use data-tool-type="read" data-tool-name="read_file_v2">
<details><summary>Tool use: **read_file_v2** • Read file: Services/WorkerControllerService.cs</summary>
</details>
</tool-use>
---
<tool-use data-tool-type="unknown" data-tool-name="ripgrep_raw_search">
<details>
<summary>Tool use: **ripgrep_raw_search**</summary>
Parameters:
```json
{
"pattern": "Recent Log Entries",
"path": "Services/WorkerControllerService.cs",
"caseInsensitive": false
}
```
Result:
```json
{
"success": {
"pattern": "Recent Log Entries",
"path": "Services/WorkerControllerService.cs",
"outputMode": "content",
"workspaceResults": {
"c:\\Users\\Nathan\\Desktop\\UFL": {
"content": {
"matches": [
{
"file": "Services/WorkerControllerService.cs",
"matches": [
{
"lineNumber": 628,
"content": "Write-Host \"\"&#96;n=== Recent Log Entries (last 30 lines) ===\"\" -ForegroundColor Cyan"
}
]
}
],
"totalLines": 1,
"totalMatchedLines": 1
}
}
}
}
}
```
Status: **completed**
</details>
</tool-use>
@@ -60338,6 +60468,35 @@ Status: **loading**
---
The log section header appears, but no content follows. This suggests the script runs but produces no output. Fixing the log reading logic to handle empty files:
---
<tool-use data-tool-type="unknown" data-tool-name="edit_file_v2">
<details>
<summary>Tool use: **edit_file_v2**</summary>
Parameters:
```json
{
"relativeWorkspacePath": "Services/WorkerControllerService.cs"
}
```
Additional data:
```json
{
"codeblockId": "bb53d695-98ef-4fef-aabd-7fe79f19d870"
}
```
Status: **loading**
</details>
</tool-use>
---