Repository navigation
refactor: fold single-consumer frames into their owners - #181653
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. |
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. |
|
Exact-head CI attribution for CI run 39961017564, attempt 1 completed with two failed test jobs and their downstream aggregate. All 104 CI jobs and 242 check runs were enumerated. Security checks and both independent review statuses passed. Six cancelled contexts are superseded advisory auto-response/context automation, not cancelled runtime or security suites.
Both failed jobs actually tested merge This is matching-signature inherited attribution, not a full dependency-disjointness claim: the subagent test imports the changed terminal tool through the coding-tool owner, and intervening main changes in subagent delivery are disclosed. The inspected folds preserve those algorithms and checks; the exact failures already execute on independent main. No failure is reported fixed or relabelled green. Proceeding through the native inherited-failure exception under the standing maintainer instruction. The earlier accepted auto request was explicitly retired once before selecting the same reviewed head. No CI rerun, rebase, repush, weakened assertion, timeout, retry, skip, suppression or security waiver. |
|
Codex review: needs maintainer review before merge. What this changesThis PR folds private single-consumer helpers into their existing owners and replaces private type aliases with equivalent inline types. Example: An agent reads terminal output containing 10%\r20%\r100%\ndone.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-directed refactor removes private indirection without an identified behavior regression, and both failing test signatures also occur on another merged PR. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway tools, agent error handling, shared parsers, Team Reports, and Control UI owners consume requests and runtime facts and produce tool results, messages, or presentation data. flowchart LR
Clients[CLI and Control UI] --> Gateway[Gateway invocation owner]
Gateway --> Tools[Agent tools]
Tools --> Results[Tool results]
Providers[Provider responses] --> Parsers[Diagnostics and text owners]
Parsers --> Results
Technical reviewBest possible solution: Land the owner-local consolidation through the existing CI policy while preserving the public exports and established runtime contracts. Do we have a high-confidence way to reproduce the issue? This PR claims a behavior-preserving refactor rather than a bug fix; source comparison supports that scope, and this review executed no target code. Is this the best way to solve the issue? Applying pr-simplify steps 1–3 found a complete cutover using existing owners, equivalent inline types, and retained observable terminal cases without new machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 05d779c0c931. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -153, Tests -9, Other -1. Total -163 across 42 files. Added test files: 0. View PR surface stats
Review metrics
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 23, 2026, 9:43 AM ET / 13:43 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
Semantically retain 9f935a5 through the current terminal read owner. Default reads return the latest 32,768 raw UTF-16 units; optional cursor and maxChars provide incremental pages capped at 131,072 units, with retained-range, truncation and remaining-output metadata. Advance past a leading surrogate half and preserve a complete pair at the page end, including a one-unit forward budget. Derive absolute cursor ranges from the existing output controller and ring, with no new persistent state. Keep the current ownedSession adoption/exact-incarnation gate and retain snapshotAgent for existing input checks and consumers. Incognito policy, current-run input authority, operator approval and shell-creation restrictions remain untouched. Document raw-output cursor semantics and how a prior cursor detects eviction. Proof: seven intended baseline failures; 83 focused tool, terminal lifecycle/rendering, Incognito and prompt-prefix checks passed. Core, agents-tools and gateway-other types plus four-file typed lint, format and line-cap checks passed. Fresh canonical independent review is clean through P2; clarified its below-threshold documentation observation without changing reviewed runtime/test source. No live Gateway, real platform PTY, deployment or latency benchmark claim. Related tools work: openclaw#125312 Rebase note: upstream openclaw#181653 folded renderTerminalBufferText into terminal-tool.ts; cursorSlice sits beside it, and its rendered-buffer table test now also asserts the paging fields. Local-Feature: bounded-terminal-paging Semantic-Source: 51c5867 Upstream-Tracking: openclaw#125312 Drop-When: Upstream supplies bounded raw UTF-16 cursor paging with surrogate-safe boundaries and eviction metadata. Rebase-Base: 0220489
What Problem This Solves
Internal owners still carry single-use helper modules and named frames that make their only consumer harder to follow.
User Impact
No user-visible change, migration, or action required. Public SDK, protocol, config, CLI, and package exports remain intact; lazy-import boundaries and security checks are unchanged.
Why This Change Was Made
Fold single-consumer helpers into their existing owners and replace private, single-annotation aliases with their exact structural types. Terminal rendering coverage now exercises the real tool read path rather than a test-only exported helper. The provider-refusal parser lives in the diagnostics module that already publicly re-exported it; both package entry points remain supported.
Net production reduction: 153 lines (+299/-452 across 38 paths). Tests shrink by 9 lines; one orphaned wrapper-inventory row is also removed, neither counted as production.
Best-effort tradeoffs accepted
None added: this cut removes indirection, not guards or supported edge-case behavior. Existing validation, bounds, authority checks, ordering, and accepted terminal-emulation limitations remain unchanged. The standalone session-memory backend is untouched.
Evidence
Focused owner tests pass across terminal reads, HTTP/RPC invocation, proxy errors and prompt-prefix stability, rate-limit/failure copy, media parsing, Team Reports, logs, diagnostics, routing, session titles, YouTube links, and the changed UI type consumers. Targeted native typing, typed lint, and format pass per packet. The terminal's 16 rendering inputs and both refusal-parser cases passed through their public entry points before and after folding.
Final format parity, assertion/mock-export ratchets, lint-suppression tests, wrapper/eager-import closure, line caps, and UI controller guards pass. Runtime and static import cycles are both zero. Fresh isolated Codex review completed with no actionable P0–P2 findings.
Changed-test local wrapper wall times: terminal suite 34.98 seconds (including worker preparation), refusal suite 3.07 seconds. No timeouts, retries, skips, suppressions, or kept-behavior expectations were relaxed. Broad builds, whole-graph typing, and E2E are left to exact-head hosted CI under the campaign CPU budget; no live-channel or device proof is claimed.
Exact-head CI run 39961017564 completed with two inherited test leaves (four assertions) and the downstream aggregate; all 104 jobs and 242 checks were enumerated. Three cron delivery-source-ID mismatches and one subagent progress-card retirement mismatch match independent scheduled-main executions, with 23 unchanged determining inputs. Security checks and review statuses pass. The complete failure table and tested-merge attribution records the native inherited-failure exception; CI is not relabelled green. No CI rerun, rebase or repush.