Skip to content

fix(test): accept remaining systemd timeout budget - #147117

Merged
vincentkoc merged 1 commit into
mainfrom
fix-systemd-timeout-budget
Sep 13, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix-systemd-timeout-budget

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes: the systemd test lane flakes when asynchronous transport discovery consumes part of a caller-provided timeout budget.

User Impact

User impact: no runtime behavior changes; CI now accepts the valid remaining timeout while preserving the subprocess kill guarantee.

Why This Change Was Made

The runtime passes each systemctl call the positive time remaining from the original 1234 ms monotonic deadline. Requiring the exact original value became stale once transport discovery could consume elapsed time.

Evidence

@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@vincentkoc
vincentkoc marked this pull request as ready for review September 13, 2026 15:09
@vincentkoc vincentkoc self-assigned this Sep 13, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS maintainer Maintainer-authored PR labels Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 11:15 AM ET / 15:15 UTC.

ClawSweeper review

What this changes

Updates the Linux service-status test to accept a positive remaining timeout within the caller’s original budget while retaining the SIGKILL assertion.

Merge readiness

✅ Ready for maintainer review

The assertion repair remains useful on current main and preserves the timeout and subprocess-kill guarantees. No actionable patch defect was found; this member-authored, protected PR should remain open for normal landing.

Priority: P3
Reviewed head: e9279c451a5b9b5b268ab823491aae5d381ec647

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct assertion repair with relevant reported validation and no blocking findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The member-authored PR changes only a test expectation for the unchanged systemd deadline owner; its focused-test results are supplemental validation, and no runtime-proof gate applies.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The member-authored PR changes only a test expectation for the unchanged systemd deadline owner; its focused-test results are supplemental validation, and no runtime-proof gate applies.
Evidence reviewed 7 items Verified introduced patch: The pinned merge-base-to-head diff changes only the timeout assertion; the positive bound, original-budget ceiling, and unchanged SIGKILL assertion enforce the relevant contract.
Production deadline contract: execSystemdUserCommand establishes a monotonic deadline before awaiting transport discovery, computes the remaining milliseconds afterward, rejects expiration, and passes the remainder to the subprocess owner.
Stronger deadline coverage remains: Existing controlled-clock tests check exact remaining budgets, expiration before fallback dispatch, and retired operation rejection; the adjacent status test still checks that an omitted deadline leaves timeout options unset.
Findings None None.
Security None None.

How this fits together

OpenClaw reads Linux service status through systemd commands. Transport discovery consumes part of each command’s timeout budget before the subprocess runs.

flowchart LR
  A[Service status request] --> B[Caller timeout budget]
  B --> C[Discover user transport]
  C --> D[Calculate remaining time]
  D --> E[Run systemctl with kill timeout]
  E --> F[Return service status]
  E --> G[Test bounded timeout and kill signal]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +1. Total +1 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 2 1 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 2 1 +1

Review metrics

None.

Technical review

Best possible solution:

Keep the existing deadline owner and align this status test with its bounded remaining-time contract, retaining the separate exact-budget regression tests.

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

Yes, from source: discovery consuming at least one millisecond makes the valid remaining timeout smaller than 1234, contradicting the old assertion. This review did not execute the test.

Is this the best way to solve the issue?

Yes. The bounded assertion matches the existing runtime contract, retains SIGKILL coverage, and leaves exact deadline arithmetic covered by controlled-clock tests.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 59067ac73947.

Labels

Label changes:

  • add P3: This is a focused test-stability repair with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Label justifications:

  • P3: This is a focused test-stability repair with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Evidence

What I checked:

  • Verified introduced patch: The pinned merge-base-to-head diff changes only the timeout assertion; the positive bound, original-budget ceiling, and unchanged SIGKILL assertion enforce the relevant contract. (src/daemon/systemd.test.ts:1548, e9279c451a5b)
  • Production deadline contract: execSystemdUserCommand establishes a monotonic deadline before awaiting transport discovery, computes the remaining milliseconds afterward, rejects expiration, and passes the remainder to the subprocess owner. (src/daemon/systemd-exec.ts:182, e9279c451a5b)
  • Stronger deadline coverage remains: Existing controlled-clock tests check exact remaining budgets, expiration before fallback dispatch, and retired operation rejection; the adjacent status test still checks that an omitted deadline leaves timeout options unset. (src/daemon/systemd-user-command-deadline.test.ts:31, e9279c451a5b)
  • Still necessary on fetched main: Fetched main retains the exact 1234 ms assertion. The inspected production executor, runtime reader, and routing-deadline tests have no differences between fetched main and this head. (src/daemon/systemd.test.ts:1548, 59067ac73947)
  • Area-history routing: Current-main history lists Peter Steinberger’s recent systemd transport work at ccd3fbb. Raw commit metadata confirms the author and recorded parent; unavailable historical objects prevented complete line-introduction verification, so this is routing context only. (src/daemon/systemd-exec.ts, ccd3fbb9181e)
  • Validation evidence and limits: The captured PR body reports ten focused passes and twelve sibling-test passes. GitHub confirms the linked original CI job failed, without independently establishing its failure text. Review-side diff checking passed and the checkout remained clean; tests were not executed under the read-only contract. (e9279c451a5b)

Likely related people:

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

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.

@vincentkoc
vincentkoc merged commit 65b5a3e into main Sep 13, 2026
163 of 164 checks passed
@vincentkoc
vincentkoc deleted the fix-systemd-timeout-budget branch September 13, 2026 15:25
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant