Repository navigation
Add a doctor command to the management scripts - #16
Open
fivetran-paulharper wants to merge 7 commits into
Open
fivetran-paulharper wants to merge 7 commits into
fivetran-paulharper wants to merge 7 commits into
Conversation
This was referenced Nov 3, 2026
fivetran-paulharper
marked this pull request as ready for review
November 3, 2026 16:25
fivetran-paulharper
marked this pull request as draft
November 3, 2026 16:25
fivetran-paulharper
force-pushed
the
paulh/run-doctor
branch
2 times, most recently
from
November 3, 2026 16:30
c42ef88 to
472fff5
Compare
fivetran-paulharper
force-pushed
the
paulh/run-doctor
branch
from
November 3, 2026 22:32
1e7ac2c to
3453420
Compare
fivetran-paulharper
force-pushed
the
paulh/run-doctor
branch
from
November 4, 2026 19:20
3453420 to
fb36f99
Compare
Runs the agent's --doctor in a throwaway container with the agent's config, memory limit and log folder, passing extra options through, and exits with the doctor's exit code. Its output is saved to logs/, since doctors up to 1.2.10 only print their report; newer doctors' own log and archive reach logs/ through the mount. The working folder is the log folder too, where newer doctors save their log when they can't read the config. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stub agent acts like a doctor that saves an archive when invoked with --doctor, so the tests check that its exit code, output and archive reach the host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
doctor-output-<time>.log looked too much like the doctor's own doctor-<time>.log. proxy-agent-manager-doctor-<time>.log sits next to the manager's log, which also records what the manager did. The test stubs now recognize the doctor by --doctor rather than by where --rm is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Newer doctors save their own log and archive, which already hold their output, so the manager now deletes its copy when a new doctor-*.log appears in logs/ during the run. It keeps the copy for doctors that save no log, like 1.2.10, and when the doctor fails before saving one. The exit code is now the doctor's even if saving the copy fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fivetran-paulharper
force-pushed
the
paulh/run-doctor
branch
from
November 5, 2026 19:23
49acd9e to
007322f
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Fallback report filenames can collide within the same second, causing overwritten or truncated diagnostics in both scripts and file-sharing failures that prevent PowerShell doctor runs from starting.
1 open issue
What changed in this PR
Adds a doctor command to both management scripts, allowing installation and connectivity checks in a separate container without stopping the running agent.
Changes:
- Reuses the agent’s configuration, log mounts, and memory limit while forwarding doctor options and preserving its exit code.
- Saves doctor logs and archives on the host, with captured output as a fallback.
- Adds unit and integration coverage and documents command usage.
| File | Description |
|---|---|
tests/stub/heartbeat.sh |
Simulates doctor output, artifacts, and failure on Linux. |
tests/stub/heartbeat.ps1 |
Simulates doctor behavior in Windows containers. |
tests/pwsh/Manager.Tests.ps1 |
Tests PowerShell doctor arguments, logging, and agent isolation. |
tests/integration/windows.ps1 |
Verifies doctor artifacts, output, and exit status on Windows. |
tests/integration/linux.sh |
Verifies doctor artifacts, output, and exit status on Linux. |
tests/bash/stubs/docker |
Adds configurable doctor behavior to the Docker stub. |
tests/bash/manager.bats |
Tests Bash doctor execution and fallback logging. |
README.md |
Documents doctor usage, saved diagnostics, and test coverage. |
proxy-agent-manager.sh |
Implements doctor execution and shared container arguments in Bash. |
proxy-agent-manager.ps1 |
Implements doctor execution and shared container arguments in PowerShell. |
Review effort: Balanced
fivetran-paulharper
marked this pull request as ready for review
November 6, 2026 18:27
fivetran-fnukanchan
self-requested a review
November 6, 2026 18:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Stack
main