Skip to content

ci: add doctor-check job to verify agent workspace health - #114

Merged
ErikBjare merged 4 commits into
masterfrom
add-doctor-check-ci
Oct 27, 2026
Merged

ErikBjare merged 4 commits into
masterfrom
add-doctor-check-ci

Conversation

@TimeToBuildBob

Copy link
Copy Markdown
Member

Summary

Why

The template currently has 3 known doctor warnings (no pyproject.toml, 3 lessons missing frontmatter, 43 lessons >100 lines). This job catches regressions where changes to the template push the warning count above an acceptable threshold.

The threshold of 5 gives headroom for the known baseline while still catching new warnings introduced by template changes.

Test plan

  • CI passes on this PR
  • gptme-agent doctor runs clean on the created workspace (≤5 warnings)
  • Future PRs that add warning-inducing changes to the template will fail this check

Adds a CI job that installs gptme from git master, creates a fresh agent
workspace from the template, runs `gptme-agent doctor`, and asserts
the warning count stays at or below 5.

This catches regressions introduced to the template that would surface
as doctor warnings when users fork it (e.g. missing frontmatter in
lessons, lessons exceeding the line limit).

Git-Session-Id: fbbb5524-beb4-42bc-9d1b-9909d9da811f
The --template-repo flag clones from a local path using branch 'master',
but the CI checkout is on the PR branch. Copy the workspace and run
fork.sh directly to avoid the branch mismatch.

Git-Session-Id: fbbb5524-beb4-42bc-9d1b-9909d9da811f
The PR checkout is in detached HEAD state, so copying .git then running
git commit fails with 'nothing to commit'. Copy workspace content without
the .git directory and reinitialize to give fork.sh a clean git repo.

Git-Session-Id: fbbb5524-beb4-42bc-9d1b-9909d9da811f
Three issues fixed:
1. `cd \"\$TMPDIR/test-agent\"` after fork.sh was a no-op (already there) —
   should be `cd \"\$TMPDIR/test-agent/test-agent\"` to enter the forked agent
2. uv and pre-commit not installed in CI → doctor reported them as missing
3. pre-commit hooks not installed → doctor warned about unhook state
4. Threshold was 5 but 8 warnings appeared; after fixes expected warnings
   are ~5 (no-origin, prek-not-found, no-pyproject, frontmatter, long-lessons)
   so threshold raised to 7 for 2 warnings of headroom

Git-Session-Id: a2a243f8-6671-442c-93a8-f7f8f68f35cd
@TimeToBuildBob

Copy link
Copy Markdown
Member Author

The CI-failure alert refers to the earlier head. The existing fix in e1b5c13 is now green: all seven checks passed, including doctor-check (https://github.com/gptme/gptme-agent-template/actions/runs/40431153352). The latest three master runs also passed. No further code change or rerun needed; ready for review.

@ErikBjare
ErikBjare merged commit 8574faf into master Oct 27, 2026
7 checks passed
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