Repository navigation
Conversation
|
🦞👀 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. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs real behavior proof before merge. Reviewed September 22, 2026, 6:29 AM ET / 10:29 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR makes remote Codex file and attachment transfers measure their remaining timeout with a monotonic clock and adds clock-rewind regression coverage. Merge readiness⛔ Blocked before merge - 2 items remain Keep open: current main and the latest release still contain the reported defect. The patch has no identified correctness finding, but production-transport proof remains incomplete. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s Codex plugin retrieves remote workspace files through the Codex app-server connection. It stages those bytes as Gateway-managed attachments before channel delivery. flowchart TD
A[Remote attachment request] --> B[Attachment batch budget]
B --> C[Chunked file reader]
C --> D{Time remaining?}
D -->|Yes| E[Codex app-server command]
E --> F[Gateway-managed attachment]
D -->|No| G[Timeout error]
F --> H[Channel delivery]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +2, Tests +52. Total +54 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep timeout accounting in the two existing transfer owners, using monotonic elapsed time and positive integer allowances without changing configuration or transport semantics. Do we have a high-confidence way to reproduce the issue? Yes, from source: rewinding Date.now() between chunks or attachments increases the remaining allowance on current main. The controlled-clock regressions target that mechanism; this review did not execute them. Is this the best way to solve the issue? Yes. Updating the existing budget owners and rounding for Codex’s integer timeout field is a narrow repair that preserves omitted-timeout behavior and existing safeguards. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0ed077d468ce. LabelsLabel changes: No label 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
HistoryReview history (3 earlier review cycles)
|
…oss wall-clock rewinds readBoundedCodexRemoteWorkspaceFile and prepareCodexRemoteWorkspaceMessageMedia measured their remaining transfer budget with Date.now(). A wall-clock rewind (NTP correction, manual clock change, or resume from sleep) widened the per-chunk command/exec timeout past the caller's original allowance, so a remote file transfer could hang well beyond requestTimeoutMs. Switch the deadline math to the monotonic clock (performance.now) and floor the remaining allowance to a positive integer, matching the six sibling files in the same module and the fix already landed for provider discovery (openclaw#155323).
91a583b to
35a4955
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@obviyus I noticed you've taken over this PR (73dda0c + the ancestry-preserving merge in 4d03fbc — thank you for keeping the contributor attribution, and for the much stronger table-driven regression tests). I had just finished putting together the production-transport evidence ClawSweeper's Revision 3 review still lists as a blocker ("production app-server budget-enforcement evidence"). Since you've taken the lead, I'd rather not touch the PR body and risk disrupting your plan — so I'm leaving the results here in case they're useful to you: Production transport proof (real
Happy to share the driver + stub scripts (tsx, ~200 lines total) if you want to reproduce it — otherwise feel free to use or ignore this as you see fit. |
|
Merged as 3750260. Thanks @SunnyShu0925 for the fix and additional transport evidence. Chunk and attachment-batch budgets now use monotonic elapsed time with integer remaining allowances. The 28 focused tests pass. The registered Gateway flow also preserved both files' bytes and demonstrated the production client's reduced-deadline timeout without dispatching further reads. That proof used a controlled peer executing the real bounded Node reader, not the native Rust app-server or a hosted provider. Applicable PR CI and the exact-head review passed (tier A, zero findings); landed through the ordinary guarded merge route. |
|
@obviyus Thanks for merge~ |
…w#155603) ## What Problem This Solves Fixes: remote Codex file reads and attachment batches can receive more than their configured transfer allowance after the system clock moves backward. ## User Impact User impact: transfer budgets decrease with elapsed time instead of growing after a clock correction. File contents, byte limits, path protections, cancellation, and existing timeout configuration remain unchanged. ## Why This Change Was Made The two existing transfer owners now measure elapsed time with the monotonic clock. Remaining milliseconds are rounded down before reaching the native integer timeout field, and an exhausted allowance still rejects before another request. An omitted file-read timeout remains omitted. No new configuration, timeout default, protocol, or permission is introduced. ## Evidence - With unchanged production code, the focused clock-rewind regressions fail in both owners: a **500ms** allowance becomes **5500ms** for the next chunk or attachment. The expired-budget cases also incorrectly complete. The omitted-timeout control passes. - With the repair, the same controlled transition yields **399ms** after **100.25ms** elapsed, preserving integer request values. Negative or sub-millisecond remaining allowances stop before another request rather than being revived to 1ms. The omitted-timeout and existing byte, path, and cancellation controls remain intact. - The focused test file passes **28 tests** in **20.69s wall time**, including **9.822s** of worker preparation. The existing batch test's real sleep was replaced with controlled clocks. - The affected extension test-type project, scoped type-aware lint, formatting, and source-size/assertion-safety checks pass. ### Production-client proof A normal Gateway `chat.send` at `4d03fbcaf033` invoked the registered Codex `message` dry-run path through the production app-server client and actual stdio JSON-RPC. A controlled peer executed the received fixed, bounded Node file-reader command against two temporary files. - **Successful chunk and batch transfer:** a 524,305-byte file required two reads, followed by a 17-byte attachment. After a 5-second rewind of the Gateway process's wall clock, the real RPC timeout values decreased **2998 → 2966 → 2907ms**. Both Gateway-staged files matched the source byte hashes, and the conversation recorded a successful prepared dry-run reply. - **Reduced-deadline enforcement:** the first response returned in **2002ms**, within its **2998ms** allowance. After the rewind, the next real RPC carried **993ms**. The production client returned `command/exec timed out` after approximately **997ms**, before the peer's delayed real-reader response at **1505ms**. No further chunk or second-attachment request was dispatched, and the conversation retained the tool error. The peer was synthetic; this is actual Gateway/client/stdio/file-reader proof, not a native Rust Codex app-server, hosted provider, or actual NTP-adjustment run. Only the task-owned Gateway process's wall clock was shifted. Its clock fault, processes, connections, and port claim were cleaned up. This does not establish an indefinite hang. The branch subsequently integrated the pinned upstream [tooling declaration prerequisite](openclaw@fbd27c6), resolving the observed UI typecheck's missing-module-declaration error; that exact typecheck now passes. The 25 inspected transfer, client, direct-caller, fixture, and dependency inputs remain byte-identical to the runtime proof. Other inherited hook and SQLite lifecycle changes were source-inspected, not runtime-replayed; the observations above remain attributed to `4d03fbcaf033`. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes: remote Codex file reads and attachment batches can receive more than their configured transfer allowance after the system clock moves backward.
User Impact
User impact: transfer budgets decrease with elapsed time instead of growing after a clock correction. File contents, byte limits, path protections, cancellation, and existing timeout configuration remain unchanged.
Why This Change Was Made
The two existing transfer owners now measure elapsed time with the monotonic clock. Remaining milliseconds are rounded down before reaching the native integer timeout field, and an exhausted allowance still rejects before another request. An omitted file-read timeout remains omitted. No new configuration, timeout default, protocol, or permission is introduced.
Evidence
Production-client proof
A normal Gateway
chat.sendat4d03fbcaf033invoked the registered Codexmessagedry-run path through the production app-server client and actual stdio JSON-RPC. A controlled peer executed the received fixed, bounded Node file-reader command against two temporary files.command/exec timed outafter approximately 997ms, before the peer's delayed real-reader response at 1505ms. No further chunk or second-attachment request was dispatched, and the conversation retained the tool error.The peer was synthetic; this is actual Gateway/client/stdio/file-reader proof, not a native Rust Codex app-server, hosted provider, or actual NTP-adjustment run. Only the task-owned Gateway process's wall clock was shifted. Its clock fault, processes, connections, and port claim were cleaned up. This does not establish an indefinite hang.
The branch subsequently integrated the pinned upstream tooling declaration prerequisite, resolving the observed UI typecheck's missing-module-declaration error; that exact typecheck now passes. The 25 inspected transfer, client, direct-caller, fixture, and dependency inputs remain byte-identical to the runtime proof. Other inherited hook and SQLite lifecycle changes were source-inspected, not runtime-replayed; the observations above remain attributed to
4d03fbcaf033.