feat: improve error info for debugging (WS logs, /debug/processes, /api/status, docs)#241
Open
shingo257 wants to merge 5 commits intocloudflare:mainfrom
Open
feat: improve error info for debugging (WS logs, /debug/processes, /api/status, docs)#241shingo257 wants to merge 5 commits intocloudflare:mainfrom
shingo257 wants to merge 5 commits intocloudflare:mainfrom
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
…us lastStderrPreview Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ts keeping error-info expansion Co-authored-by: Cursor <cursoragent@cursor.com>
…s (LF for *.sh); ignore local PR docs Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves error and debug information to make troubleshooting easier (wrangler tail, debug endpoints, and public status).
Changes
WebSocket proxy logging (
src/index.ts)closeanderrorwithside,code, andreason/messagesowrangler tailcan be grepped easily./debug/processes(src/routes/debug.ts)?failed=1: return only gateway-related failed/completed processes (start-moltbot, clawdbot gateway).logs=trueorfailed=1, addlastFailedStderrPreview: sanitized stderr (first 500 chars) from the most recent failed start-moltbot process.src/utils/sanitize.tsto redact secrets (e.g.sk-ant-*, Slack tokens) from log excerpts./api/status(src/routes/public.ts)lastStderrPreview(300 chars) so callers can see a hint without calling/debug/processes.Docs (
AGENTS.md)/api/status,/debug/processes?logs=true,wrangler tailfor[WS] close/[WS] error), and exit code 126 (CRLF,tr -d '\r', chmod in Dockerfile).Notes
cloudflare/moltworkermain has new commits. You can still open this PR; maintainers can merge after resolving conflicts, or we can rebase this branch on upstreammainand push again.