Repository navigation
fix(gateway): deterministic channels.status ordering with probe-contract tests - #114362
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 27, 2026, 2:10 AM ET / 06:10 UTC. ClawSweeper reviewWhat this changesThis PR sorts channel-status probe tasks by channel ID so keyed status maps are deterministic, while adding gateway tests for concurrent probes, stable map ordering, and per-channel timeout isolation. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 2 items remain Keep this PR open for maintainer handling. The proposed sort is a narrow determinism change that preserves the separate registry-defined Priority: P3 Review scores
Verification
How this fits togetherThe Gateway flowchart LR
A[Channel registry] --> B[Gateway status request]
B --> C[Requested channel selection]
C --> D[Sorted probe task list]
D --> E[Bounded concurrent probes]
E --> F[Keyed channel status maps]
A --> G[Registry UI order]
F --> H[Gateway status response]
G --> H
Before merge
Agent review detailsSecurityNone. PR surfaceSource +4, Tests +53. Total +57 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Preserve the split between registry-defined Do we have a high-confidence way to reproduce the issue? Yes from source-level evidence: configure two delayed channel probes and compare the keyed Is this the best way to solve the issue? Likely yes: sorting the probe-task input is a contained way to stabilize keyed map construction while retaining the separately returned registry UI order. A live response artifact should confirm that no client relies on the old completion-dependent object enumeration order. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0406e6636916. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Investigating a 2441ms
channels.statusresponse on team.openclaw.ai (near-zero CPU in the same window — await-bound). The investigation found the handler already probes channels with five-wide bounded concurrency and 1–30s per-probe timeouts; the latency came from a slow probe batch within budget, not a serialization bug. What the investigation did surface: status-map insertion order followed completion order, and none of the concurrency/isolation behavior was locked by tests.Why This Change Was Made
Honest scope note: this is a determinism fix plus contract-locking tests, not a latency change — the concurrency the original evidence asked for already existed.
User Impact
Stable channel ordering in status payloads (prompt-cache friendly, no UI reorder flicker); the probe concurrency/isolation contract can no longer regress silently.
Evidence
channels.ts): sort probe tasks by channel id.gpt-5.6-sol, xhigh): clean.