Skip to content

fix(test): join Gateway completion before teardown - #160387

Merged
vincentkoc merged 1 commit into
mainfrom
fix/gateway-completion-fixture-custody
Sep 28, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/gateway-completion-fixture-custody

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Related: #160010
Validation prerequisite for #160311.

What Problem This Solves

The Gateway completion E2E fixture can assert before detached native suspension finishes, failing unrelated lint-memory fixes with a still-pending delivery.

User Impact

No runtime behavior changes. The test retains its real cold-worker path and original suspended-state assertion while waiting for the work it started before Gateway teardown.

Why This Change Was Made

The fixture owns setup and settlement. Registering the run before seeding persists its canonical physical store bindings. The existing root-work observer joins detached cleanup and its asynchronous scope tails; the one-second polling loop is removed. No timeout increase, worker warming, mock broadening, or production change.

Evidence

  • Original failure: exact CI job, graph head 116d96e16434e1e346ff7c1e1faa78ad1a5606b8. The fixture and inspected runtime owners are byte-identical to base e0e21ec70cfed25353c06711c1d5151ef5ce936c. The same failure was recorded on independent branches in refactor(gateway): schedule remote skill refresh #160318.
  • Independent P0–P2 source review and scoped autoreview are clean. Whitespace check passes. Production delta: 0; tests: +14/-8.
  • Focused cold Gateway E2E passed: 1/1 on Blacksmith Testbox. The unchanged assertion observed suspended / permanent_failure / expiry. Vitest wall time was 54.62s; the complete managed command was 731.777s, including the required private QA rebuild (656.8s) and worker preparation. The build started without a usable build stamp on a retained worker from the interrupted setup; this is not a clean-machine performance benchmark.
  • The E2E process tree had a 12 GiB kernel limit and swap disabled. Targeted formatting passed in 0.242s and Gateway test types passed in 76.989s under 7 GiB. Typed lint passed in 220.471s under 7 GiB with zero warnings/errors, including SDK declaration preparation.
  • The complete source fingerprint matches 43,412 inputs / 60df088d2d1f792a35f5a23ed7f344e6ee0d53c446a4e0097971864ec22d1639 before and after execution. The tested file matches this head (SHA256 9a5820b4b69972cb22c1c28728b48dd55b7a9bc549cb717c1ba3557eeea0a088 before and after). Five declared generated plugin bundles are excluded from the source fingerprint; authored inputs remain checked.
  • Earlier setup attempts exited 137 under 7 GiB and timed out during a 12 GiB build with lint-specific Go tuning applied globally. Neither reached Vitest or counts as a test result. The successful E2E command removed those overrides from build/setup; lint alone retains them.
  • Exact-head ClawSweeper review found no actionable source/security defect. Its sole before-merge request and rank-up move were the focused E2E result and wall time, now recorded above. The reviewed head is unchanged. Exact-head CI, attempt 1, passed all 17 selected jobs with zero failures, including the aggregate gate.

This small test-only prerequisite is required to validate the new lint graph repair; it does not claim to fix a production completion defect or to independently prove seed order caused the observed CI failure.

@vincentkoc vincentkoc self-assigned this Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 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 28, 2026 11:14
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Sep 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 28, 2026, 7:22 AM ET / 11:22 UTC.

ClawSweeper review

What this changes

The branch changes a Gateway end-to-end test to register a subagent run before seeding its delivery row, then wait for detached completion work before checking suspension.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Current main still uses a timed assertion in this Gateway fixture, and the submitted repair addresses the fixture’s detached cleanup path. The branch remains useful; its changed test has not yet produced a focused result.

Priority: P2
Reviewed head: 8e9a45d3d380a8fe1c4686dcf281f1eca904cce1

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The source change is narrow and fits the lifecycle owner, but its focused execution result and measured cost remain pending.
Proof confidence 🌊 off-meta tidepool Not applicable: The changed Gateway fixture is intended to exercise native suspension through a real server, but the captured worker attempts stopped before Vitest and show no after-change result. The member-authored PR is exempt from the contributor proof gate; no stored-data contract changes.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The changed Gateway fixture is intended to exercise native suspension through a real server, but the captured worker attempts stopped before Vitest and show no after-change result. The member-authored PR is exempt from the contributor proof gate; no stored-data contract changes.
Evidence reviewed 6 items Introduced test change: The pinned PR delta changes only the Gateway fixture: registration precedes seeding, and the existing root-work observer replaces timed polling.
Current main still has the original fixture: At the fetched main revision, seeding precedes registration and the assertion uses vi.waitFor; the file matches the PR merge base.
Registration supplies canonical store bindings: The test helper resolves physical requester and controller store paths and writes the canonical record back into the supplied object, supporting the new registration-before-seeding order.
Findings None None.
Security None None.

How this fits together

The Gateway fixture creates a completed subagent run and resumes its pending delivery. The registry and delivery store settle that work before the test checks the resulting state.

flowchart LR
A[Gateway test fixture] --> B[Register subagent run]
B --> C[Seed delivery row]
C --> D[Resume completion]
D --> E[Join detached work]
E --> F[Assert suspended delivery]
Loading

Before merge

  • Complete next step (P2) - Complete the focused cold Gateway E2E run on this head and record its result and measured wall time before merge.
Agent review details

Security

None.

PR surface

Tests +6. Total +6 across 1 file.

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

Review metrics

None.

Technical review

Best possible solution:

Keep the fixture tied to canonical delivery state and join its owned cleanup; confirm the suspended result in a focused cold Gateway run and record the test cost.

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

No deterministic current-main replay is established. The linked CI failure and independent branch report show the pending-state assertion failure, while current main still uses the timed fixture path.

Is this the best way to solve the issue?

Yes, the change uses the existing observer for the detached cleanup owner and preserves the suspended-state assertion. A focused run is still needed to confirm the result.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 162dea17b031.

Labels

Label changes:

  • add P2: The fixture can fail unrelated validation, but the branch changes no user runtime behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The changed Gateway fixture is intended to exercise native suspension through a real server, but the captured worker attempts stopped before Vitest and show no after-change result. The member-authored PR is exempt from the contributor proof gate; no stored-data contract changes.

Label justifications:

  • P2: The fixture can fail unrelated validation, but the branch changes no user runtime behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The changed Gateway fixture is intended to exercise native suspension through a real server, but the captured worker attempts stopped before Vitest and show no after-change result. The member-authored PR is exempt from the contributor proof gate; no stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Sho Jikumaru: 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.

  • Record a focused run of the changed Gateway E2E on the pinned head, including its wall time and the observed suspended-state assertion.

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 f504ddd into main Sep 28, 2026
188 checks passed
@vincentkoc
vincentkoc deleted the fix/gateway-completion-fixture-custody branch September 28, 2026 11:28
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
Join detached native completion work before asserting suspended delivery and closing the Gateway. Seed the canonical registered record first and retain the cold worker path and original assertions.

Validation: focused Gateway E2E 1/1 passed; format, Gateway test types and typed lint passed under bounded process-tree budgets; exact-head CI green. Independent autoreview and ClawSweeper found no actionable code findings; the requested E2E result and wall time are recorded in the PR.

Related: openclaw#160010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant