Skip to content

Add a doctor command to the management scripts - #16

Open
fivetran-paulharper wants to merge 7 commits into
mainfrom
paulh/run-doctor
Open

fivetran-paulharper wants to merge 7 commits into
mainfrom
paulh/run-doctor

Conversation

Comment thread tests/bash/stubs/docker Resolved
Comment thread proxy-agent-manager.sh Resolved
@fivetran-paulharper
fivetran-paulharper changed the base branch from paulh/ci-tests to main November 4, 2026 19:20
Copilot AI balanced review requested due to automatic review settings November 5, 2026 19:18
fivetran-paulharper and others added 6 commits November 5, 2026 11:22
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread proxy-agent-manager.sh Resolved
@fivetran-paulharper
fivetran-paulharper marked this pull request as ready for review November 6, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants