IDE-chat mirror — tail Claude transcripts into CodeWatch#23
Conversation
…odeWatch Adds an IDE-chat-in-CodeWatch channel: the running IDE conversation shows up in CodeWatch as a per-handle chat feed. - src/confirmations.mjs: new /ide-chat/<handle> endpoint on the confirmations server. POST appends an event; GET (?since=<iso>&limit=) returns events. Backed by a bounded in-memory ring buffer (500/handle) — memory stays flat on long-running daemons, history is intentionally non-persistent (a restart drops it; the tailer repopulates). - bin/iak-claude-tail.mjs: tails ~/.claude/projects/*.jsonl and POSTs each user/assistant message to the endpoint. Fully env-driven (IAK_HANDLE, IAK_DAEMON_URL, IAK_PROJECTS_DIR, IAK_TAIL_INTERVAL, IAK_TAIL_INCLUDE_TOOLS, IAK_TAIL_MAX_TEXT) — no machine-specific paths baked in. Independent of the action-status/poller work; both only add code (no shared regions), so they merge in any order. Tests stay 15/15. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1fc23c3664
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const res = await fetch(`${DAEMON_URL}/ide-chat/${encodeURIComponent(HANDLE)}`, { | ||
| method: 'POST', | ||
| headers: { 'Content-Type': 'application/json' }, | ||
| body: JSON.stringify(event), |
There was a problem hiding this comment.
Send the daemon bearer token from tailer
In authenticated daemon configs (mcp.confirmations.auth_token set), startConfirmationsServer rejects every request before route dispatch unless an Authorization: Bearer ... header is present, but the new tailer only sends Content-Type. Those deployments will just log 401s and never populate /ide-chat/<handle>, so the CodeWatch mirror is unusable unless the auth token can be supplied and forwarded here.
Useful? React with 👍 / 👎.
| res.end(JSON.stringify({ ok: false, error: 'invalid json' })); | ||
| return; | ||
| } | ||
| const event = appendIdeChatEvent(handle, payload); |
There was a problem hiding this comment.
Reject non-object IDE chat payloads
When a client sends syntactically valid but non-object JSON such as null to POST /ide-chat/<handle>, this call passes it into appendIdeChatEvent, which immediately dereferences raw.role and throws an uncaught TypeError; that terminates the daemon instead of returning a 400 like the other HTTP handlers. Validate that the parsed payload is an object, or catch errors from appending, before storing the event.
Useful? React with 👍 / 👎.
Adds an IDE-chat-in-CodeWatch channel: the running IDE conversation shows up in CodeWatch as a per-handle chat feed. Recovered from the Mini clone.
src/confirmations.mjs: new/ide-chat/<handle>endpoint on the confirmations server.POSTappends an event;GET(?since=<iso>&limit=) returns events. Backed by a bounded in-memory ring buffer (500/handle) — memory stays flat, history is intentionally non-persistent (restart drops it; the tailer repopulates).bin/iak-claude-tail.mjs: tails~/.claude/projects/*.jsonland POSTs each user/assistant message to the endpoint. Fully env-driven (IAK_HANDLE,IAK_DAEMON_URL,IAK_PROJECTS_DIR, …) — no machine-specific paths baked in.Independent of the action-status/poller PR — both only add code with no shared regions, so they merge in any order. Tests stay 15/15.