fix(worker): connect tail WebSocket from the CLI, not the Worker server #338
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
gmackie/ForgeGraph!338
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/worker-tail-cli-ws"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
fg worker tailnever worked — forgegraf.com is a CF Worker and cannot open the outbound tail wss. Server now mints the session only; the CLI connects the pre-authorized wss URL from Go (gorilla/websocket, trace-v1). Unblocks diagnosing runtime 500s (e.g. daily-dose).🤖 Generated with Claude Code
`fg worker tail` failed with `Fetch API cannot load: wss://tail.developers.workers.dev/…`: forgegraf.com is itself a Cloudflare Worker, and Workers can't open an outbound WebSocket to the CF tail endpoint via fetch. So the server-side tailWorker (which did the Upgrade fetch) could never work. Move the WS to the CLI (a real machine): the server now only MINTS the tail session (createTailSession → POST /workers/scripts/<name>/tails, returns the pre-authorized {id,url}); POST /api/fg/workers/<name>/tail returns {id,url,seconds, probeUrl}; and `fg worker tail` connects the wss URL from Go (gorilla/websocket, trace-v1 subprotocol — already vendored), fires the --url probes mid-window, reads tail events for the window, and prints exceptions/logs. The session ends on WS disconnect / CF expiry. Removes the dead server-side Upgrade-fetch + TailSocket shim. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>