Repository navigation
Conversation
Bind incremental log cursors to the existing Gateway boot ID. Preserve same-boot reconnect reuse, reset for changed or unknown boots, and keep failed reset retries cursor-free. Extend the existing reconnect test across all four cases.
|
🦞👀 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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR reuses log cursors only across reconnects to the same known Gateway boot. Example: The Logs page holds cursor 100 for /tmp/gateway.log when boot-a restarts as boot-b with a larger replacement file.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness✅ Ready for maintainer review Keep this PR open: it narrowly repairs a source-verifiable restart regression that remains on fetched main, and no introduced correctness or security defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI Logs page consumes Gateway connection snapshots and logs.tail responses, maintaining a bounded visible log window and an in-memory byte cursor. flowchart LR
A[Gateway boot identity] --> B[Connection snapshot]
B --> C[Logs page]
C --> D[logs.tail request]
D --> E[Configured log file]
E --> F[Redacted log window]
F --> C
Technical reviewBest possible solution: Keep cursor invalidation in the existing Logs page owner and preserve incremental reads only for the same known boot. Do we have a high-confidence way to reproduce the issue? Source establishes the failure when a restarted Gateway replaces its log file with one larger than the retained cursor; no target code was executed during this review. Is this the best way to solve the issue? The fix addresses cursor ownership directly, retains the intended same-boot optimization, and clears invalid state before an awaited refresh so polling can recover after failure. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cd3eb90f8752. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +6, Tests +54. Total +60 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 15, 2026, 4:24 AM ET / 08:24 UTC. |
Integrate current main after GitHub continued reporting unknown mergeability. Preserve the reviewed Logs restart cursor patch unchanged.
|
Superseded by #172828, landed as 65023f7. Its Logs repair places boot tracking in The upstream regression, |
Superseded by #172828 (
65023f793e3f4215921cff8dd1d8611e6d0b98e9), which places the same boot-aware cursor behavior in theloadLogsowner. Historical proof is preserved below.What Problem This Solves
Fixes stale log rows and missing new records after a Gateway restarts with a replaced log file.
User Impact
The Control UI Logs page replaces its old window after a Gateway restart while retaining efficient incremental reads for reconnects to the same known Gateway boot. Failed refreshes keep the existing rows visible and retry safely.
Why This Change Was Made
The reconnect optimization in #172864 reused a byte cursor across Gateway restarts. That cursor can point into an unrelated record when the log file is replaced at the same path. Bind cursor reuse to the existing Gateway boot ID, and clear the cursor before requesting a fresh window when the boot changes or is unknown. Clearing it before the request also keeps a subsequent poll safe if the refresh fails.
Evidence
c3414361b698d0362a2acee00b3eafdd32b8f4fc. The unchanged test replaces the log file while the Gateway is stopped and then verifies the new window after restart.pnpm test ui/src/pages/logs/logs-page.test.tsx --maxWorkers=1: all 18 tests passed.435deb1c1386f0aeb9c42c772233aaf8481ffe30. The complete two-file authored patch is byte-identical to the reviewed patch, so the 18-test result and independent review are reused. No current-head CI result is claimed forb7d07e1c2ffc83f897d47d3fedf080da18b94d39.4ae97565112a9fad04c321177cac8cb2948dd754, completed with 33 successful, 26 skipped, and 5 failed jobs. The real-Gateway shard containing the unchanged Logs restart regression passed again; security-fast also passed.#203chip, and a stale PR-chip label expectation (#103469versusopenclaw/openclaw#103469), plus the aggregate gate. Their complete visible failure blocks match historical scheduled main run 38713991924. All 57 traced failure-determining source, fixture, runner, and configuration inputs are identical across the actual CI base, tested merge, and that main baseline. Provider-redacted values remain unknown. This is historical attribution for the previous head, not current-head gate evidence.