Repository navigation
refactor(logging): remove redundant stderr spy casts - #137238
Conversation
Use the existing boolean stderr spy pattern in the environment and file-cap tests. Preserve all nine scenarios, assertions, queue drains and cleanup while removing four unnecessary double assertions.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 3, 2026, 6:18 AM ET / 10:18 UTC. ClawSweeper reviewWhat this changesThe PR replaces four doubly asserted stderr test spies with direct boolean-returning spies in two logging test suites. Merge readiness✅ Ready for maintainer review Keep open. This fresh, maintainer-labeled PR is a correct, behavior-neutral test cleanup; the current main revision still has the redundant casts and no blocking correctness or security concern was found. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw logging writes diagnostic output to stderr for invalid log-level configuration and file-log transport failures. The changed tests intercept that output while preserving assertions over those diagnostic paths. flowchart LR
Config[Logging configuration] --> Env[Environment validation]
Config --> Transport[File log transport]
Env --> Stderr[stderr diagnostics]
Transport --> Stderr
Stderr --> Tests[Logging test spies]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -8. Total -8 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain the direct boolean-returning spies so the affected tests follow the established logging-test idiom without changing runtime behavior. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR changes no runtime behavior and only simplifies existing test doubles. Is this the best way to solve the issue? Yes: deleting the redundant casts at the test seam is the narrowest maintainable cleanup, and the sibling logging tests already use direct boolean spies. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bc426f67f7f1. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* commit '13b1f71c7010baaf2394555198e2fc04bef03586': (283 commits) fix(ui): retire stale MCP feedback across context changes (#128490) fix(agents): clarify set-identity workspace output (#126320) fix(auth): preserve OAuth metadata during session SDK refresh (#127988) fix(agents): recover catalog worker after generation mismatch (#127712) fix(memory-wiki): reject out-of-range claim confidence (#125656) ci: remove redundant contract runs and costly test work (#137220) fix(release): assert the Codex CLI pin the candidate declares (#137136) test(voice-call): reuse shared guards and deferred gates (#137262) fix(cron): isolate scheduler-disabled shared-store writes (#131733) fix(telegram): surface allowed custom reactions in react guidance (#129817) test(infra): reuse the shared npm call presence guard (#137254) fix: generated images disappear after failed tool calls (#131226) fix(docs): match source anchor checks to published sections (#137157) fix(backup): preserve audit capture across slow snapshots (#130962) fix(release): preserve legacy gh log reads (#137016) fix(memory-core): make forget rewrites atomic (#131383) fix(agents): write settings atomically (#131431) fix(plugins): keep the memory indexing runtime with the selected slot owner (#131779) fix(ci): pin iOS screenshot evidence to workflow revision (#136334) test(logging): remove redundant stderr spy casts (#137238) ... # Conflicts: # scripts/e2e/lib/codex-release-package-assertions.mjs
Use the existing boolean stderr spy pattern in the environment and file-cap tests. Preserve all nine scenarios, assertions, queue drains and cleanup while removing four unnecessary double assertions.
What Problem This Solves
Four stderr spies use double type assertions even though the stream write method already returns boolean.
Why This Change Was Made
Return
truedirectly, matching the existing transport and console test pattern. The two files retain all nine scenarios and every assertion, queue drain and cleanup step. Production code is unchanged; test code decreases eight lines.User Impact
No runtime behavior changes. Environment warning deduplication, JSON diagnostics, file rotation and continued writes remain covered, along with the existing transport durability, privacy and console error-handling tests.
Evidence