fix(codex): app inventory error diagnostics stay UTF-16 safe#102414
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 2:24 AM ET / 06:24 UTC. Summary PR surface: Source +1, Tests +6. Total +7 across 2 files. Reproducibility: yes. from source. Current main and the latest release use raw Review metrics: none identified. Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow helper reuse after normal exact-head or merge-queue checks pass, preserving the existing 500-unit limit, redaction behavior, cache semantics, and Codex app/list protocol. Do we have a high-confidence way to reproduce the issue? Yes, from source. Current main and the latest release use raw Is this the best way to solve the issue? Yes. Reusing the existing UTF-16-safe helper in the local serializer is narrower than changing Codex protocol handling or adding another one-off truncation path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 583ca34bf88d. Label changesLabel justifications:
Evidence reviewedPR surface: Source +1, Tests +6. Total +7 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Land-ready verification at exact head
No changelog entry is required because this only corrects internal diagnostic serialization. |
|
Merged via squash.
|
…w#102414) * fix(codex): keep app inventory error messages UTF-16 safe * refactor(codex): unify app inventory error truncation --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Codex app inventory refresh diagnostics could serialize a long top-level error message with a dangling UTF-16 surrogate when an
app/listfailure crossed the 500-code-unit limit. Nested error-data strings already used safe truncation, but the top-level message did not.Why This Change Was Made
truncateSerializedErrorTextowner.truncateUtf16Safeprimitive and preserve the existing 500-unit limit, ellipsis, HTML omission, secret redaction, cache behavior, and protocol.The upstream Codex contract was checked directly:
app/listis registered as an unserialized request incodex-rs/app-server-protocol/src/protocol/common.rs:732-735; its response isAppsListResponseincodex-rs/app-server-protocol/src/protocol/v2/apps.rs:159-168; and concurrent connector failures become JSON-RPC internal-error strings incodex-rs/app-server/src/request_processors/apps_processor.rs:164-279. OpenClaw therefore owns sanitizing those error strings before retaining and logging diagnostics.User Impact
Codex app inventory refresh diagnostics remain valid UTF-16 when long upstream errors contain emoji or other astral characters at the truncation boundary. Normal errors and app inventory behavior are unchanged.
Evidence
Exact head:
87ea557c48f0611b7047f85b1359cbd5802be513app-inventory-cache.test.ts, 13 passed.oxfmtandgit diff --check: passed.codex-rs/app-server/tests/common/test_app_server.rs:815-819.The new regression serializes
${"x".repeat(499)}🚀tailand asserts${"x".repeat(499)}..., proving the truncator backs up before the split surrogate instead of retaining a lone high surrogate.Real behavior proof
app/listerror diagnostic truncationRisk checklist