Skip to content

IDE-chat mirror — tail Claude transcripts into CodeWatch#23

Merged
ThinkOffApp merged 1 commit into
mainfrom
feat/ide-chat-mirror
Jul 6, 2026
Merged

IDE-chat mirror — tail Claude transcripts into CodeWatch#23
ThinkOffApp merged 1 commit into
mainfrom
feat/ide-chat-mirror

Conversation

@ThinkOffApp

Copy link
Copy Markdown
Owner

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. POST appends 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/*.jsonl and 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.

…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>
@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown

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.

@ThinkOffApp ThinkOffApp merged commit c47ed75 into main Jul 6, 2026
3 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread bin/iak-claude-tail.mjs
Comment on lines +136 to +139
const res = await fetch(`${DAEMON_URL}/ide-chat/${encodeURIComponent(HANDLE)}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(event),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread src/confirmations.mjs
res.end(JSON.stringify({ ok: false, error: 'invalid json' }));
return;
}
const event = appendIdeChatEvent(handle, payload);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant