Repository navigation
refactor(queue): remove single-use helper indirection - #129108
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 4:20 AM ET / 08:20 UTC. ClawSweeper reviewWhat this changesThe PR inlines private queue-summary, Unicode-preview, and collect-drain helpers into their exported queue owners without changing the public helper API. Merge readinessNo actionable defect found in this focused refactor; current main still retains the three private indirections. This maintainer-authored, Priority: P3 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherQueue helpers turn pending queue state into overflow prompts and decide whether collected messages must drain individually. Auto-reply and the embedded TUI consume those results to preserve delivery order and render queued-message prompts. flowchart LR
A[Queued messages] --> B[Queue helpers]
B --> C[Overflow summary]
B --> D[Collect-drain decision]
C --> E[Prompt for agent]
D --> F[Auto-reply delivery]
E --> G[Embedded TUI]
F --> G
Decision needed
Why: The author is a repository member and the PR carries the protected Before merge
Agent review detailsSecurityNone. PR surfaceSource -41. Total -41 across 1 file. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the net-negative inlining only after the exact resulting head remains cleanly mergeable and passes the repository’s required checks. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-preserving internal refactor, not a report of a failing user flow. Is this the best way to solve the issue? Yes: the code moves each single-use private implementation into its actual owner while preserving the summary, truncation, and collect-drain sequences shown by callers and tests. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7d9cb48804e4. LabelsLabel 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 (1 earlier review cycle)
|
|
Merged via squash.
|
What Problem This Solves
Maintainer-requested simplification of the internal queue owner: overflow summaries, UTF-16-safe previews, and collect-mode draining each passed through a private helper used by only one caller, duplicating argument shapes and obscuring where queue behavior actually lives.
Why This Change Was Made
Keep the existing exported queue-helper boundaries and move their implementations directly into the functions that own summary rendering and cross-channel collect decisions. Fold single-use text elision into the existing summary-line owner. This removes three private indirections and 41 production lines without changing signatures, output, ordering, reservation behavior, or error propagation.
User Impact
No user-visible behavior change. Queue overflow summaries, safe Unicode truncation, individual cross-channel delivery, protected in-flight work, and TUI queued prompts keep the same behavior with less internal code.
Evidence
node scripts/run-vitest.mjs src/utils/queue-helpers.test.ts src/auto-reply/reply/queue.collect.test.ts src/auto-reply/reply/queue.in-flight.test.ts src/tui/embedded-backend.test.ts— 224 tests passed across four owner, auto-reply, and TUI caller suites.OPENCLAW_CHECK_CHANGED_SKIP_DEADCODE=1 node scripts/check-changed.mjs -- src/utils/queue-helpers.ts— passed all changed-file guards, production and test typechecks, lint, and owner-boundary checks. The unchanged production/full-tree/script dead-export scans separately passed on the initial run; the retry skipped only their already-green duplicate after correcting isolated UI dependency resolution.git diff --checkAI-assisted, maintainer-requested refactor.