Repository navigation
fix(discord): prevent credentials from appearing in non-JSON errors - #119536
Patrick-Erichsen merged 2 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 7:07 AM ET / 11:07 UTC. ClawSweeper reviewWhat this changesThe PR redacts reflected credentials from Discord JSON and non-JSON API error summaries while preserving status and retry diagnostics. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open: current main still inserts unredacted upstream JSON or text error detail into Discord errors, while this focused PR applies the existing forced redactor at both affected Discord boundaries with aligned loopback proof. Priority: P1 Review scores
Verification
How this fits togetherThe Discord plugin makes authenticated REST requests and turns failed upstream responses into diagnostics for operators and agents. Response text flows through the error formatter or gateway metadata summary before becoming an error or fallback log. flowchart LR
A[Authenticated Discord request] --> B[Upstream error response]
B --> C[Response parser and HTML summary]
C --> D[Discord error formatter]
C --> E[Gateway metadata fallback]
D --> F[Shared credential redactor]
E --> F
F --> G[Visible diagnostic or log]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +9, Tests +80. Total +89 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the focused owner-plugin repair after the exact merge result is green, keeping the forced shared redactor as the single boundary for untrusted Discord diagnostics. Do we have a high-confidence way to reproduce the issue? Yes: current source shows untrusted response detail reaching DiscordApiError without redaction, and the PR provides an exact-head loopback reproduction for HTML and JSON reflections; untrusted contributor code was not run locally. Is this the best way to solve the issue? Yes: the final formatter covers both JSON and text REST errors, while the shared summary change protects the separate gateway-metadata diagnostic consumer without adding a parallel policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f68ecec40c54. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
Addressed the JSON sibling path and added public exact-head runtime proof to the PR body: https://github.com/Alix-007/openclaw/actions/runs/30989854767\n\n@clawsweeper re-review |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Patrick-Erichsen
left a comment
There was a problem hiding this comment.
Approved at exact head 2bf546d. No blocking findings. The Discord owner boundary now applies the canonical forced redactor to reflected JSON and non-JSON API details while preserving status and retry diagnostics; exact-head loopback proof and required CI are green.
…penclaw#119536) * fix(discord): redact non-JSON API error details * fix(discord): redact JSON API error details
Bind bounded error diagnostics to the actual outgoing request headers for shared web tools and both Perplexity transports. Preserve caller cancellation and replace case-insensitive owned headers without combining credentials. Reuse the provider error redactor and remove duplicate xAI parser-only test paths while retaining real HTTP and sibling coverage. Production -18 lines; total -14 lines including regression tests and documentation. Refs openclaw#120200, openclaw#117304, openclaw#119536. Co-authored-by: zenglingbiao <[email protected]>
…and reason phrase (#120200) * fix(web): redact request credentials from provider errors Bind bounded error diagnostics to the actual outgoing request headers for shared web tools and both Perplexity transports. Preserve caller cancellation and replace case-insensitive owned headers without combining credentials. Reuse the provider error redactor and remove duplicate xAI parser-only test paths while retaining real HTTP and sibling coverage. Production -18 lines; total -14 lines including regression tests and documentation. Refs #120200, #117304, #119536. Co-authored-by: zenglingbiao <[email protected]> * fix(tooling): install managed signals before spawning children Prevent early SIGTERM from orphaning a detached compiler before its supervisor registers the child. Retain shared handlers for concurrent commands and clean them up after synchronous or asynchronous spawn failure. Reproduce the race at the real process boundary and consolidate stale type comments and one-use registration wrappers. --------- Co-authored-by: Peter Steinberger <[email protected]>
…and reason phrase (openclaw#120200) * fix(web): redact request credentials from provider errors Bind bounded error diagnostics to the actual outgoing request headers for shared web tools and both Perplexity transports. Preserve caller cancellation and replace case-insensitive owned headers without combining credentials. Reuse the provider error redactor and remove duplicate xAI parser-only test paths while retaining real HTTP and sibling coverage. Production -18 lines; total -14 lines including regression tests and documentation. Refs openclaw#120200, openclaw#117304, openclaw#119536. Co-authored-by: zenglingbiao <[email protected]> * fix(tooling): install managed signals before spawning children Prevent early SIGTERM from orphaning a detached compiler before its supervisor registers the child. Retain shared handlers for concurrent commands and clean them up after synchronous or asynchronous spawn failure. Reproduce the race at the real process boundary and consolidate stale type comments and one-use registration wrappers. --------- Co-authored-by: Peter Steinberger <[email protected]>
AI-assisted: This change was implemented and validated with Codex.
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 users troubleshooting Discord API failures could see a bot credential in surfaced error details when a proxy or upstream reflected the request authorization in either JSON or non-JSON output.
Why This Change Was Made
Discord error details now pass through the shared forced tool-payload redactor at the final formatting boundary used by both JSON and text responses. Existing normalization, response limits, rate-limit behavior, and HTTP status reporting remain intact.
User Impact
Discord failures retain their status and useful non-sensitive diagnostic text without exposing a reflected bot token.
Evidence
2bf546d413f736cc647162b48aab36ddff1d3679.node scripts/run-vitest.mjs extensions/discord/src/api.test.ts --reporter=verbose— 1 file, 21 tests passed through the real loopbackrequestDiscordpath.oxfmt --check,oxlint, andgit diff --checkpassed for the touched files.