Skip to content

fix(ci): drain docs-agent Git trees before recovery - #133124

Merged
steipete merged 1 commit into
mainfrom
steipete/git-owner-docs-agent
Aug 30, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/git-owner-docs-agent

Conversation

@steipete

@steipete steipete commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Related: #132183

What Problem This Solves

Fixes an issue where Docs Agent could retry a fetch, query workflow history, select a review base, inspect stale-main state, publish workflow outputs, or run commit/push recovery after a Git leader exited while its child or grandchild was still alive. GNU timeout bounded the fetch leader but did not prove process-tree extinction before those decisions.

Why This Change Was Made

Docs Agent now prepares the reviewed canonical Git owner at dd4528b6393e7d00063067a080ca7241b48ce475 immediately after checkout. Two trusted inline gate policies own the Git work before and after the existing REST/JQ cadence block; a connected commit policy owns diff, config, staging, commit, fetch, push, and stale-main readback. The three docs-only enforcement producers use straight-line unbounded owner calls.

Gate and commit retain five fetch attempts and their existing 120-second fetch deadlines. Gate keeps 2/4/6/8-second inter-attempt backoffs; commit fetch and push recovery keep 2/4/6/8/10-second backoffs, including the final failed attempt. Push, local reads, docs-only checks, config, add, and commit remain unbounded. Only typed ordinary Git failure or FetchTimeout can enter retry or fallback after verified cleanup; setup, process inspection, cleanup failure, and cancellation are terminal.

The one-hour cadence block is byte-identical to current main, including REST .id current-run exclusion, cancelled/skipped conclusion exclusions, and review-base ordering. Checkout, trigger trust, permissions, concurrency, action pin and inputs, docs checks, bot identity, refspecs, authentication, stale/no-change outcomes, and output shape are unchanged. No new deadline, retry, workflow input, dependency, or process supervisor was added.

User Impact

There is no OpenClaw runtime behavior change. Maintainers get deterministic Docs Agent runs: no retry, fallback, GitHub query, output publication, commit, push reconciliation, or success can overlap an earlier Docs Agent Git process tree.

Evidence

  • Pre-fix actual workflow bodies: 34 intended lifecycle failures. Thirty-two cases observed live descendants at retry, read, GitHub-query, config/add/commit, push, output, or exit boundaries; two additional timeout/cancellation cases exposed retries against unreclaimed locks.
  • Focused final lifecycle proof: 34 passed, 101 unrelated tests skipped. It covers manual admission, ordinary Git 125/143 collisions, timeout recovery, cancellation, cleanup uncertainty, superseded CI, review-base fallback, no-change success, fetch/push retry and stale-main decisions, and all three docs-only producers.
  • Full shared Git-owner sibling proof: 165 passed, 89 platform-specific skips.
  • Docs/workflow/routing proof: 596 passed, 2 skips before rebase; post-rebase focused workflow/routing proof: 69 passed, 695 unrelated tests skipped.
  • The full post-rebase changed-surface gate passed conflict-marker checks, ratchets, dependency and ownership guards, three dead-export scans, three typecheck lanes, core/script lint, and formatting.
  • actionlint, owner projection, targeted oxfmt --check, docs inventory, git diff --check, and fresh autoreview passed.

Native Linux/Windows execution and authenticated Docs Agent publication were intentionally not performed locally. The actual workflow bodies and process lifecycle are exercised on macOS; exact-head CI owns native/action packaging proof without using the workflow token locally.

Workflow/routing/docs delta: +127/-70 (net +57). Tests and test support: +497/-26 (net +471). Product runtime and canonical owner implementation: +0/-0. The positive workflow delta is the typed connected recovery policy replacing ambiguous shell statuses; the old shell Git paths are deleted.

@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: L maintainer Maintainer-authored PR labels Aug 30, 2026
@steipete
steipete marked this pull request as ready for review August 30, 2026 06:39
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready verification is complete for head cbbf57326f66b09127e637f5596f88c036d1a0b7.

No ClawSweeper comment or review had been published at the latest exact-head read, so there were no Rank-up moves: to apply or skip. The exact-head ClawSweeper dispatch completed successfully; a late publisher result does not block landing under repository policy.

Behavior proof:

  • Before the repair, 34 actual Docs Agent workflow-body scenarios failed. Thirty-two observed live fake-Git descendants at retry, read, GitHub-query, config/add/commit, push, output, or exit boundaries; two additional timeout/cancellation scenarios retried against unreclaimed locks.
  • Focused final lifecycle proof: 34 passed, 101 unrelated tests skipped. It covers manual admission, ordinary Git 125/143 collisions, timeout recovery, cancellation, cleanup uncertainty, superseded CI, review-base fallback, no-change success, fetch/push recovery, stale-main decisions, and all three docs-only producers.
  • Shared owner sibling proof: 165 passed, 89 platform-specific skips.
  • Docs/workflow/routing proof: 596 passed, 2 skips before rebase; post-rebase focused proof: 69 passed, 695 unrelated tests skipped.
  • The full post-rebase changed-surface gate passed conflict-marker checks, ratchets, dependency and ownership guards, all three dead-export scans, all three selected typecheck lanes, core/script lint, and formatting.
  • actionlint, owner projection, targeted oxfmt --check, docs inventory, git diff --check, and fresh autoreview passed.
  • One broad combined local Vitest command timed out an unrelated test-projects prerequisite case at its existing 120-second limit under aggregate load. That case and the Docs Agent routing case passed together in isolation in 12.34 seconds; exact-head CI is green.

Exact-head hosted proof:

Native Linux/Windows execution and authenticated Docs Agent publication were intentionally not run locally. The actual workflow bodies and process lifecycle were exercised on macOS; exact-head CI supplies native/action packaging proof without exposing the workflow token.

Workflow/routing/docs delta is +127/-70; tests and test support are +497/-26. Product runtime and the canonical Git owner implementation are unchanged. The positive workflow delta is the typed connected recovery policy replacing ambiguous shell statuses; the old shell Git paths are deleted. Issue #132183 remains open for the other consumer families.

@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 2:58 AM ET / 06:58 UTC.

ClawSweeper review

What this changes

The PR replaces Docs Agent’s direct shell Git calls with the pinned Git-owner process lifecycle policy and adds focused workflow, lifecycle, routing, and fixture coverage.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open for normal maintainer review. The introduced workflow consistently routes Docs Agent Git work through the existing process-tree owner, and I found no blocking correctness or security defect; it remains an automation-risk change awaiting exact-head CI completion.

Priority: P2
Reviewed head: cbbf57326f66b09127e637f5596f88c036d1a0b7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with comprehensive fault-injection coverage and no blocking finding; exact-head workflow completion remains the merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored CI reliability PR is exempt from the external-contributor real-behavior gate; its supplied lifecycle harness evidence is supplemental.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored CI reliability PR is exempt from the external-contributor real-behavior gate; its supplied lifecycle harness evidence is supplemental.
Evidence reviewed 6 items Introduced owner-boundary repair: The PR adds a pinned Git-owner preparation step and routes gate fetch/revision decisions through its policy interface before workflow-history queries or output publication.
Shared owner contract: The pinned owner creates an isolated session/process group, drains it in a finally block, and raises on nonzero Git completion only after cleanup; this is the intended ownership boundary reused by the workflow.
Current-main problem remains: Fetched current main still uses GNU timeout around fetch and direct Git revision, validation, and commit/push operations, so the PR's central repair is not already implemented.
Findings None None.
Security None None.

How this fits together

Docs Agent is a scheduled GitHub Actions workflow that lets Codex refresh documentation and commits permitted docs-only changes to main. The gate decides whether a run may proceed, then the docs update is validated and committed through Git.

flowchart LR
  A[Trusted CI trigger] --> B[Docs Agent gate]
  B --> C[Git process owner]
  C --> D[Cadence and revision checks]
  D --> E[Codex documentation update]
  E --> F[Docs-only validation]
  F --> G[Commit and push]
Loading

Before merge

  • Resolve merge risk (P1) - This is a net-positive CI workflow policy change; exact-head CI still needs to exercise the selected macOS and Windows lifecycle lanes before merge.
  • Complete next step (P2) - This maintainer-labeled PR has no discrete repair finding; retain it for ordinary exact-head CI and maintainer handling.
Agent review details

Security

None.

PR surface

Tests +471, Docs +2, Config +54, Other +1. Total +528 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 7 497 26 +471
Docs 1 2 0 +2
Config 1 122 68 +54
Generated 0 0 0 0
Other 2 3 2 +1
Total 11 624 96 +528

Review metrics

Metric Value Why it matters
Production versus test delta CI workflow/docs/scripts +125/-69 (net +56); tests and test support +499/-27 (net +472) The production growth is concentrated in replacing ambiguous shell recovery with explicit owner-boundary policy; the larger test delta exercises the lifecycle outcomes.

Merge-risk options

Maintainer options:

  1. Complete exact-head lifecycle validation (recommended)
    Wait for the Docs Agent workflow and Git-owner lifecycle lanes on this head before merging the automation behavior change.

Technical review

Best possible solution:

Retain the shared Git-owner policy as the sole lifecycle owner for Docs Agent, with the existing cadence and docs-only constraints preserved, once exact-head automation coverage completes.

Do we have a high-confidence way to reproduce the issue?

Yes, source-reproducible: the lifecycle fixture injects failed, hanging, cancelled, and cleanup-failure Git process trees at the changed workflow boundaries, though this read-only review did not rerun it.

Is this the best way to solve the issue?

Yes: reusing the pinned canonical Git-process owner at each Docs Agent decision boundary is preferable to retaining separate shell timeout and recovery paths.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 49a8b1cb2138.

Labels

Label changes:

  • add P2: This repairs CI workflow reliability without changing OpenClaw runtime behavior.
  • add merge-risk: 🚨 automation: The PR changes scheduled workflow gate, recovery, and publication behavior that can affect Docs Agent execution after merge.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Label justifications:

  • P2: This repairs CI workflow reliability without changing OpenClaw runtime behavior.
  • merge-risk: 🚨 automation: The PR changes scheduled workflow gate, recovery, and publication behavior that can affect Docs Agent execution after merge.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Evidence

What I checked:

  • Introduced owner-boundary repair: The PR adds a pinned Git-owner preparation step and routes gate fetch/revision decisions through its policy interface before workflow-history queries or output publication. (.github/workflows/docs-agent.yml:43, cbbf57326f66)
  • Shared owner contract: The pinned owner creates an isolated session/process group, drains it in a finally block, and raises on nonzero Git completion only after cleanup; this is the intended ownership boundary reused by the workflow. (.github/actions/git-owner/owner.py:202, dd4528b6393e)
  • Current-main problem remains: Fetched current main still uses GNU timeout around fetch and direct Git revision, validation, and commit/push operations, so the PR's central repair is not already implemented. (.github/workflows/docs-agent.yml:52, 49a8b1cb2138)
  • Lifecycle regression coverage: Focused tests inject ordinary failures, timeouts, cancellation, cleanup failure, stale-main decisions, and failing docs-only enforcement producers, asserting that later operations do not occur after terminal cleanup failure. (test/scripts/ci-linux-git.test.ts:1361, cbbf57326f66)
  • Workflow contract preservation: The workflow guard verifies the unchanged checkout, permission, concurrency, Codex-action inputs, cadence hash, and the two owner-policy boundaries around the cadence query. (test/scripts/ci-workflow-guards.test.ts:6041, cbbf57326f66)
  • Introduction provenance: The PR commit has recorded parent 136eab0, and its raw-parent diff introduces the Git-owner step and policy calls rather than inheriting them from the base. (.github/workflows/docs-agent.yml:43, cbbf57326f66)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let the exact-head Docs Agent and Git-owner lifecycle CI lanes complete before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 4f92b28 into main Aug 30, 2026
251 checks passed
@steipete
steipete deleted the steipete/git-owner-docs-agent branch August 30, 2026 07:00
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR scripts Repository scripts size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant