Repository navigation
fix(agents): balance forced open-fence chunks - #174964
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d95efcc8f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Exact-head landing evidence: 7d95efc. CI run38992800528 completed. Complete paginated exact-head census:190 checks,64 success,122 skipped,1 neutral,2 failures,1 superseded metadata cancellation. No unfinished suite. Cancelled PR context/evidence117278502022 has successful same-head replacement117278647268/run38992800535. All substantive runtime/type/lint/cycle checks and current protected security/dependency statuses passed.
Coordinator main-flakes inventory and last six completed scheduled-main identities inspected; this newer exact independent signature is the evidence, not a job-name comparison or local timeout. No rerun/re-push/rebase for green. Fresh independent P0-P2 review is scoped-clean on exact snapshot; direct production-owner probe fails before/passes after all3 scenarios; required lint/format/suppression proof passes. Local owner suite never reached cases before its existing startup deadline, explicitly documented; exact-head runtime CI supplies broad proof. Production+1/test+53, actual bug-fix exception. Bot inline4300816737 is declined under the campaign's explicit best-effort doctrine: forcing midway through a Markdown delimiter can commit incomplete syntax and affect subsequent formatting. Production callers force at text/message flush boundaries, not each delta (btw-stream.ts158/176, stream-rendering.ts561); the example deliberately forces then resumes a partial delimiter, without a cited human incident. Buffering across forced output would add a different parser/flush contract; source bytes/metadata remain intact, security/data/FIFO/settlement unaffected. This is an accepted cosmetic tradeoff, not a claim the example is fixed. PR body updated accordingly. Existing degradation for impossibly small fence caps remains. Phase E unchanged. Native workflow fallback under coordinator campaign authority: this lane already recorded two genuine native infrastructure failures (state-lease startup timeout and provisioning EPIPE, on prior bookkeeping landing). This PR's canonical review-init also failed shared origin/main CAS; exact lock owner375703b0f0d3d00f1f426b8d19cc523e2678dfff recovered only after its tools exited. A subsequent full56821-file provisioning attempt was deliberately interrupted, not misclassified as another infrastructure failure. No native merge was submitted and no outcome receipt exists. The fallback reuses the authorized broken-workflow exception, pins the exact reviewed head and does not bypass security or failure attribution. All known task-owned native processes are joined before submission; unfinished worktree registration, if any, is retained for native closeout. |
Main hourly 38995631641 exposed two stale assertions. The deliberate f6f54db (#174838) tradeoff no longer reconstructs historical chunk boundaries after an authoritative native item rewrite. Assert the complete corrected body exactly while retaining once-only early-prefix checks; ordinary append, directive, voice and source-occurrence cases stay intact. c0e26d5 (#174964) intentionally balances unfinished fences during a forced flush. Expect the synthetic closer at early and terminal delivery, with the literal MEDIA line preserved as code and no media attachment. No production behavior changes. Both original failures reproduced on main 789c8c0. Focused proof: 31 tests pass with --maxWorkers=1; owning agents-root test types, targeted type-aware lint, formatting, and independent P2 review pass. No CI dispatch, rerun, skip, retry, or timeout change.
Main hourly 38995631641 exposed two stale assertions. The deliberate a7855f2 (openclaw#174838) tradeoff no longer reconstructs historical chunk boundaries after an authoritative native item rewrite. Assert the complete corrected body exactly while retaining once-only early-prefix checks; ordinary append, directive, voice and source-occurrence cases stay intact. 367e8a0 (openclaw#174964) intentionally balances unfinished fences during a forced flush. Expect the synthetic closer at early and terminal delivery, with the literal MEDIA line preserved as code and no media attachment. No production behavior changes. Both original failures reproduced on main 26e1077. Focused proof: 31 tests pass with --maxWorkers=1; owning agents-root test types, targeted type-aware lint, formatting, and independent P2 review pass. No CI dispatch, rerun, skip, retry, or timeout change.
What Problem This Solves
Force-draining an unfinished fenced code block below the transport cap bypasses the existing fence splitter. It can publish an unclosed Markdown fragment and lose the reopen context for subsequent streamed text. The same failure occurs in a fresh short block and a short tail after a capped emission.
User Impact
Forced streaming checkpoints keep code fragments balanced and within the transport cap, then resume without losing code or replaying the source. No new configuration or feature is introduced.
What changed
Route forced unfinished fences through the existing bounded close/reopen path, including below-cap tails. Reserve the synthetic closer when deciding whether an oversized language hint must shorten. Keep original source offsets and continuation ownership in the existing chunker; no new state or parser is added.
One owner regression covers fresh and resumed open fences, a language hint that needs shortening, the hard cap, exact body text and original source coverage, and absence of an extra final message. Existing tests remain intact.
Best-effort tradeoffs accepted
An explicit forced flush that ends midway through an opening-language line or a closing delimiter commits that fragment; a later continuation can retain the shortened language hint or remain formatted as code. The bot's synthetic force-then-append example is valid, but no human incident was cited. Production forces occur at text/message flush boundaries rather than every token delta. Accept this rare, cosmetic malformed-boundary case instead of adding buffering across a forced output contract; original source coverage remains intact. Inline review4300816737 is declined for that explicit best-effort tradeoff, not claimed fixed.
Fence markers too large to fit even bare balanced wrappers retain their existing degradation behavior. No security, durability, configuration, protocol, or SDK contract changes. Phase E standalone memory is untouched.
Evidence
The direct production-owner probe fails on the baseline with
checkpoint missing closing fenceand passes all three corrected scenarios after the fix. An initially incorrect fixture expected a fitting language hint to shorten; it was corrected to exercise a hint that actually exceeds the balanced budget.Fresh independent P0–P2 review completed scoped-clean (confidence0.91) on an exact task-owned source snapshot; normalized full-index diff SHA256 matches the real worktree:2be7de6591f27c866c0b1f62fa5b823ed36994653649546510e70db90c984270. The full-repository attempt was interrupted during evidence verification and supplied no review outcome; its replacement completed final source verification.
Two-file type-aware lint and formatting pass. The required suppression audit passes all3tests (114.57s Vitest;157.11s wrapper). The owner-suite attempt reached no test case before the existing900000ms no-output deadline; its wrapper ended after1149.21s while preparing workers. That is an infrastructure proof gap, not a product assertion failure or passing suite. No timeout, retry, skip or suppression was added. Exact-head PR CI is the broad owner/sibling behavior/type/cycle gate. Runtime proof uses isolated HOME/OpenClaw/XDG state and one local worker. No production import edge is added. Check-changed dry-run classified both touched paths; broad local graph checks were not run under the campaign host budget.
Production delta: +1 net line. Test delta: +53 lines. This is a small real-bug fix, separate from the bookkeeping cleanup.
CI attribution and landing
Exact-head CI38992800528 is complete: runtime/type/lint/cycle gates passed. The sole substantive red is inherited mock-exports in the unchanged CLI update fixture at src/cli/update-cli/update-command-service-maintenance-native.test-support.ts:52; the aggregate gate is downstream. Exact same diagnostic appears in unrelated run38991638278/job117275393534; main-owned fixture/scanner are byte-identical between both CI main revisions. Line-cap/assertion-safety pass. The posted landing failure table records complete check enumeration, current security/dependency success, independent provenance, native infrastructure failures and the authorized exact-head fallback. No CI rerun, green-seeking repush or drift-only rebase.