Repository navigation
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 3:11 AM ET / 07:11 UTC. ClawSweeper reviewWhat this changesThe PR makes agent-bundle language-server JSON-RPC response decoding reject malformed UTF-8 and adds regression coverage for a raw invalid byte in an otherwise valid response. Merge readinessThis PR addresses a real current-main transport defect: malformed LSP body bytes are replacement-decoded before JSON parsing, so they can become a different valid response. The branch makes that boundary strict and routes failure through the existing session-failure and process-termination path; no blocking patch defect was found. Priority: P2 Review scores
Verification
How this fits togetherAgent bundles spawn configured language servers and exchange JSON-RPC frames over child-process stdio. The LSP framing parser converts response bytes into tool results; malformed frames reject outstanding requests and terminate the affected language-server session. flowchart LR
A[Agent bundle request] --> B[Language server child process]
B --> C[Stdio response bytes]
C --> D[LSP framing parser]
D --> E{Valid UTF-8 and JSON?}
E -->|Yes| F[Tool result]
E -->|No| G[Reject requests and stop session]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +6, Tests +35. Total +41 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Merge the narrow strict-decoding repair after the normal checks finish, retaining the existing framing-error lifecycle for every malformed LSP response body. Do we have a high-confidence way to reproduce the issue? Yes. Current main visibly replacement-decodes the declared response body before JSON parsing, and the proposed regression constructs a raw invalid byte inside otherwise valid JSON; the PR body also provides an after-fix spawned-child stdio transcript. Is this the best way to solve the issue? Yes. Fatal UTF-8 decoding at the byte-to-text boundary is the narrowest maintainable repair and deliberately reuses the existing parser failure, pending-request rejection, and child-process cleanup path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1f130ce61d62. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Maintainer verification for original contributor head
|
|
Merged via squash.
|
* origin/main: (41 commits) test(ci): update memory helper routing expectation (#117295) fix(canvas): emit successful control results in JSON mode (#117297) fix(imessage): settle native inbound reply delivery (#117282) fix(agents): reject invalid UTF-8 LSP responses (#117271) fix(line): centralize card and template message alt text (#117280) fix(release): validate candidates before Docker publication (#117252) fix(media): validate provider-owned generated media downloads (#117281) fix(feishu): restore custom HTTPS API domains (#117278) fix(models): reuse prepared plugin metadata (#117131) fix(agents): stop fallback after delivered-but-failed attempts (#114628) fix(memory): reuse targeted session corpus snapshot (#117247) fix(matrix): reconcile durable sends after response loss test(release): repair full validation regressions (#116931) fix(linux-canvas): report socket watcher fallback (#109502) fix(codex): preserve authoritative turn completion (#117185) fix(canvas): preserve widgets across derived-name collisions (#117132) fix(channels): config validation rejects documented channels.<id>.configWrites on 13 channels (#117206) fix(msteams): prevent duplicate final replies (#116398) fix(doctor): session SQLite restore installs an empty session index over the valid archive (#117221) fix(plugins): preserve workspace plugins across CLI and control UI (#117265) ...
* origin/main: (41 commits) test(ci): update memory helper routing expectation (openclaw#117295) fix(canvas): emit successful control results in JSON mode (openclaw#117297) fix(imessage): settle native inbound reply delivery (openclaw#117282) fix(agents): reject invalid UTF-8 LSP responses (openclaw#117271) fix(line): centralize card and template message alt text (openclaw#117280) fix(release): validate candidates before Docker publication (openclaw#117252) fix(media): validate provider-owned generated media downloads (openclaw#117281) fix(feishu): restore custom HTTPS API domains (openclaw#117278) fix(models): reuse prepared plugin metadata (openclaw#117131) fix(agents): stop fallback after delivered-but-failed attempts (openclaw#114628) fix(memory): reuse targeted session corpus snapshot (openclaw#117247) fix(matrix): reconcile durable sends after response loss test(release): repair full validation regressions (openclaw#116931) fix(linux-canvas): report socket watcher fallback (openclaw#109502) fix(codex): preserve authoritative turn completion (openclaw#117185) fix(canvas): preserve widgets across derived-name collisions (openclaw#117132) fix(channels): config validation rejects documented channels.<id>.configWrites on 13 channels (openclaw#117206) fix(msteams): prevent duplicate final replies (openclaw#116398) fix(doctor): session SQLite restore installs an empty session index over the valid archive (openclaw#117221) fix(plugins): preserve workspace plugins across CLI and control UI (openclaw#117265) ...
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Fixes an issue where agent bundle LSP requests could accept a response containing malformed UTF-8 when the replacement character still left the body as valid JSON. The corrupted payload could then be returned to the caller with
�instead of failing the transport.Why This Change Was Made
LSP response bodies are now decoded with a fatal UTF-8
TextDecoderbefore JSON parsing. Decode failures enter the existing framing-error path, which rejects pending requests, terminates the language-server process, and latches the error for later requests;ignoreBOM: truepreserves the previous JSON BOM rejection behavior.User Impact
Malformed language-server responses can no longer be silently altered and treated as valid results. Callers receive a clear framing error, and the compromised LSP process is shut down instead of continuing with corrupted data.
Evidence
Fresh red on the pinned
mainbaseline:Focused regression suite after the fix:
Strong live E2E used the production
createBundleLspToolRuntime, a real spawned Node child process, and real stdioContent-Lengthframes. Gateway is not applicable because this runtime talks directly to its language-server child.Formatting and whitespace checks also passed (
oxfmt --checkandgit diff --check).