Conversation
Incidental whitespace/formatting cleanup surfaced by `pnpm check --fix` while working on remote logging. No behavioral changes. Co-authored-by: Cursor <cursoragent@cursor.com>
Introduces a hosted log relay so production apps can push NDJSON logs to a public URL and a local debug-agent session can read them back. Solves the problem that `localhost` endpoints don't work for production bugs. - New package `@debug-agent/remote`: Cloudflare Worker with a SQLite-backed Durable Object (`LogSession`). Each session is created by `POST /sessions` (nanoid id), auto-expires after 1 hour via a DO alarm that calls `deleteAll()`, and enforces 10K entries / 10KB per entry / 100MB total limits with `413 Payload Too Large`. Routes: `POST/GET/DELETE /s/:id` and SSE at `GET /s/:id/stream` (replays buffered logs then streams live). Returns `410 Gone` for expired or unknown sessions. CORS open on every response. - New `remote` subcommand in `debug-agent` CLI with `--daemon`, `--json`, and interactive modes. SSE is parsed manually from `fetch()` — no EventSource dep. Default Worker URL is configurable via `--url`. - Updated SKILL.md with a local-vs-remote decision section and remote variants of STEP 0, STEP 2, STEP 4, plus a remote API reference table. Deployed at https://debug-agent-remote.aidenbai.workers.dev and end-to-end verified via the debug-agent skill workflow. Co-authored-by: Cursor <cursoragent@cursor.com>
|
✅ React Review — 93/100 (unchanged) · Copy prompt for agentReviewed by react-review for commit 2bc948a. Configure here. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| bufferedLogs: rows.length, | ||
| }; | ||
|
|
||
| const removeWriter = () => { |
|
|
||
| newlineIndex = buffer.indexOf("\n"); | ||
| } | ||
| } |
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
@debug-agent/remote, a Cloudflare Worker + SQLite-backed Durable Object that acts as a hosted NDJSON log relay so production code (nolocalhost) can push logs to a public URL and the local agent can read them back.debug-agent remoteCLI subcommand (--daemon,--json, interactive) that creates sessions on the Worker and streams logs over SSE parsed fromfetch()(no EventSource dep).SKILL.mdwith a local-vs-remote decision section and remote variants of STEP 0 / STEP 2 / STEP 4 plus a remote API reference table..wranglerand.dev.vars*into.gitignore. Incidental formatter cleanup ondebug-agent-browserlives in its own commit.Worker design
POST /sessions→ returns{ sessionId, endpoint, streamUrl, expiresAt }using a 21-charnanoid.LogSessionDurable Object schedules an alarm atDate.now() + 3_600_000; the alarm handler broadcasts anexpiredSSE event, closes writers, and callsctx.storage.deleteAll()(compatibility date2026-02-24so the alarm is cleared in the same call).413 Payload Too Large: max 10K entries, 10KB per entry, 100MB total.idfield on the payload is used for dedup via an indexedentry_idcolumn.connected→ replay bufferedlogevents →replay-complete→ livelogevents broadcast fromPOST /s/:id.410 Gone.*) on every response andOPTIONS *preflight.Deployed at https://debug-agent-remote.aidenbai.workers.dev.
Test plan
wrangler dev— all routes exercised locally (create, ingest, read NDJSON, SSE replay + live, DELETE, dedup, 413 over-size, 410 unknown, CORS preflight).wrangler deploysucceeds; live worker passes the same smoke tests.pnpm build && pnpm test(63/63 tests pass) andpnpm checkclean.debug-agent remote --daemonprints session info and exits.debug-agent remote --jsonstreams remote logs as NDJSON to stdout.curl ENDPOINT, confirmed hypothesis from cited log lines, fixed, re-verified withrunId=post-fixlogs.Made with Cursor