Repository navigation
test(worker): pin the late stop recheck and the logged status filters - #1587
Conversation
…us filters A stop committed after the worker's last running check is only seen when publication locks the Agent: the candidate must stay unpublished and must not retire its predecessor. The logged failure fields must drop a status text with spaces and a non-HTTP numeric code such as a gRPC status.
… stop Review follow-up: the candidate stops itself, then the stop work stops the still-serving predecessor before cleaning up the candidate. Release the blocked activation even if the stop request fails.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 7, 2026, 12:39 AM ET / 04:39 UTC. ClawSweeper reviewWhat this changesAdds PostgreSQL worker tests for a stop committed during activation and for filtering unsafe reason text and non-HTTP status codes from logs. Merge readiness✅ Ready for maintainer review Keep open: the two tests add useful regression coverage beyond current main, with no actionable patch defect found. Repository policy reserves this PR for maintainer triage. Priority: P3 Review scores
Verification
How this fits togetherThe OpenClaw Control Plane worker consumes durable deployment and stop requests from PostgreSQL and invokes Compute Drivers. It publishes active revisions, records deployment outcomes, and emits filtered diagnostic events. flowchart TD
A[Deployment and stop requests] --> B[PostgreSQL work queue]
B --> C[Controller worker]
C --> D[Compute activation]
D --> E[Locked publication recheck]
E --> F[Active revision or stopped deployment]
D --> G[Filtered diagnostic events]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Retain these focused scenarios in the existing PostgreSQL worker suite to protect publication ordering and diagnostic filtering. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds regression coverage rather than reporting a current-main failure. Source inspection confirms the exercised boundaries; no tests were run during review. Is this the best way to solve the issue? Yes: extending the existing PostgreSQL fixture keeps the scenarios at their production worker boundary and adds rejection and race coverage absent from adjacent cases. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 533f50c76676. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Problem
A mutation sweep of
apps/controller/src/worker.tson main (after #1553 and #1554) left three real test gaps. They survive all 33 test files that import the controller worker or the PostgreSQL work queue:reasonmust be one CamelCase word (a Kubernetes Status reason). A free-text HTTP status text such asService Unavailablewas not tested, so dropping the filter went unnoticed.status. A Driver error with another numeric code, such as a gRPC client error (code: 14, UNAVAILABLE), was not tested, so accepting any number went unnoticed.Change
This change is test-only. It adds two tests to
tests/integration/postgres-worker-agent-revision.test.mjsand uses the existing worker-revision fixture helpers.REVISION_STOPPED.worker.completedpending fields keep status 503, drop the reason, and log no status for code 14.Verification
postgres-platformfiles and 7 non-PostgreSQL worker importers. With it, all three are killed by the new tests.taskset -c 0-1, each round gated on 1-min load < 40) on 46ab382.prettier --checkandeslint --max-warnings 0are clean on the file.git merge-treeagainst this head gives the same conflicted files and the same number of conflict hunks in this file as against main, so the change adds no new conflict.Risks
finallyblock, and every wait is bounded.