Skip to content

feat: ai-chat reference project + MCP agent-chat tooling (4/4)#3546

Merged
ericallam merged 1 commit into
mainfrom
feature/ai-chat-reference-and-cli
May 14, 2026
Merged

feat: ai-chat reference project + MCP agent-chat tooling (4/4)#3546
ericallam merged 1 commit into
mainfrom
feature/ai-chat-reference-and-cli

Conversation

@ericallam
Copy link
Copy Markdown
Member

@ericallam ericallam commented May 10, 2026

Summary

A complete Next.js reference project that exercises chat.agent end-to-end, plus the CLI MCP tools that let Claude Code, Cursor, and similar IDE agents drive a deployed chat.agent task from the editor. Builds on #3545.

Design

references/ai-chat is a full Next.js app: prisma-backed persistence, multi-chat sidebar, per-chat model picker, debug panel, tool examples (getCurrentTime, searchHackerNews, createGithubIssue, PR review helpers, code sandbox), and smoke tests. It's intended both as a copy-paste starting point and as a place to regression-test SDK changes.

The CLI gains MCP tools (start_agent_chat, send_agent_message, close_agent_chat, list_agents) so an IDE agent can converse with a deployed chat.agent task. The dev runtime adds one-shot OOM kill on the run controller and skills bundling in the build pipeline.

Test plan

  • cd references/ai-chat && pnpm install && pnpm trigger:dev
  • Open the Next.js app, create a chat, exchange messages, verify persistence across reloads
  • Trigger a tool requiring HITL approval, approve from the UI, verify resume
  • From an IDE agent, call start_agent_chat against the running dev task, send a message, verify the response streams back

Stack

Part of a 4-PR stack. Merge bottom-up.

  1. feat: Sessions dashboard, task_kind, and chat-ready hardening (1/4) #3542main — Sessions dashboard + chat-ready hardening
  2. feat(sdk): chat.agent — runtime + browser transport (2/4) #3543feat: Sessions dashboard, task_kind, and chat-ready hardening (1/4) #3542chat.agent runtime + browser transport
  3. feat(webapp): agent-view dashboard for chat.agent runs (3/4) #3545feat(sdk): chat.agent — runtime + browser transport (2/4) #3543 — agent-view dashboard
  4. This PR (feat: ai-chat reference project + MCP agent-chat tooling (4/4) #3546) → feat(webapp): agent-view dashboard for chat.agent runs (3/4) #3545

This is part 2 of 5 in a stack made with GitButler:

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 10, 2026

🦋 Changeset detected

Latest commit: 8673d42

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 32 packages
Name Type
@trigger.dev/sdk Patch
trigger.dev Patch
@trigger.dev/python Patch
@internal/sdk-compat-tests Patch
references-ai-chat Patch
d3-chat Patch
references-d3-openai-agents Patch
references-nextjs-realtime Patch
references-realtime-hooks-test Patch
references-realtime-streams Patch
references-telemetry Patch
@trigger.dev/build Patch
@trigger.dev/core Patch
@trigger.dev/plugins Patch
@trigger.dev/react-hooks Patch
@trigger.dev/redis-worker Patch
@trigger.dev/rsc Patch
@trigger.dev/schema-to-json Patch
@trigger.dev/database Patch
@trigger.dev/otlp-importer Patch
@trigger.dev/rbac Patch
@internal/cache Patch
@internal/clickhouse Patch
@internal/llm-model-catalog Patch
@internal/redis Patch
@internal/replication Patch
@internal/run-engine Patch
@internal/schedule-engine Patch
@internal/testcontainers Patch
@internal/tracing Patch
@internal/tsql Patch
@internal/zod-worker Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 10, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b747ed0c-9ac8-4919-a46f-199618d64a6c

📥 Commits

Reviewing files that changed from the base of the PR and between 9acd6cd and 8673d42.

⛔ Files ignored due to path filters (56)
  • references/ai-chat/.gitignore is excluded by !references/**
  • references/ai-chat/.nvmrc is excluded by !references/**
  • references/ai-chat/DEMO-SHORTHAND.md is excluded by !references/**
  • references/ai-chat/DEMO.md is excluded by !references/**
  • references/ai-chat/README.md is excluded by !references/**
  • references/ai-chat/next-env.d.ts is excluded by !references/**
  • references/ai-chat/next.config.ts is excluded by !references/**
  • references/ai-chat/package.json is excluded by !references/**
  • references/ai-chat/postcss.config.mjs is excluded by !references/**
  • references/ai-chat/prisma.config.ts is excluded by !references/**
  • references/ai-chat/prisma/migrations/20260305112427_init/migration.sql is excluded by !references/**
  • references/ai-chat/prisma/migrations/20260306165319_add_user_model/migration.sql is excluded by !references/**
  • references/ai-chat/prisma/migrations/20260327180000_remove_user_tool/migration.sql is excluded by !references/**
  • references/ai-chat/prisma/migrations/20260425091008_add_chat_model_and_user_github_token/migration.sql is excluded by !references/**
  • references/ai-chat/prisma/migrations/20260425121916_add_session_id_to_chat_session/migration.sql is excluded by !references/**
  • references/ai-chat/prisma/migrations/20260427053743_simplify_chat_session_for_run_manager/migration.sql is excluded by !references/**
  • references/ai-chat/prisma/migrations/migration_lock.toml is excluded by !references/**
  • references/ai-chat/prisma/reset-chats.sql is excluded by !references/**
  • references/ai-chat/prisma/schema.prisma is excluded by !references/**
  • references/ai-chat/src/app/actions.ts is excluded by !references/**
  • references/ai-chat/src/app/api/chat/route.ts is excluded by !references/**
  • references/ai-chat/src/app/chats/[chatId]/page.tsx is excluded by !references/**
  • references/ai-chat/src/app/chats/layout.tsx is excluded by !references/**
  • references/ai-chat/src/app/chats/page.tsx is excluded by !references/**
  • references/ai-chat/src/app/globals.css is excluded by !references/**
  • references/ai-chat/src/app/layout.tsx is excluded by !references/**
  • references/ai-chat/src/app/page.tsx is excluded by !references/**
  • references/ai-chat/src/components/chat-app.tsx is excluded by !references/**
  • references/ai-chat/src/components/chat-settings-context.tsx is excluded by !references/**
  • references/ai-chat/src/components/chat-sidebar-wrapper.tsx is excluded by !references/**
  • references/ai-chat/src/components/chat-sidebar.tsx is excluded by !references/**
  • references/ai-chat/src/components/chat-view.tsx is excluded by !references/**
  • references/ai-chat/src/components/chat.tsx is excluded by !references/**
  • references/ai-chat/src/lib/chat-tools-schemas.ts is excluded by !references/**
  • references/ai-chat/src/lib/chat-tools.ts is excluded by !references/**
  • references/ai-chat/src/lib/code-sandbox.ts is excluded by !references/**
  • references/ai-chat/src/lib/models.ts is excluded by !references/**
  • references/ai-chat/src/lib/pr-review-helpers.ts is excluded by !references/**
  • references/ai-chat/src/lib/pr-review-tools.ts is excluded by !references/**
  • references/ai-chat/src/lib/prisma.ts is excluded by !references/**
  • references/ai-chat/src/trigger/chat-client-test.ts is excluded by !references/**
  • references/ai-chat/src/trigger/chat-tools.ts is excluded by !references/**
  • references/ai-chat/src/trigger/chat.ts is excluded by !references/**
  • references/ai-chat/src/trigger/pr-review.ts is excluded by !references/**
  • references/ai-chat/src/trigger/skills/time-utils/SKILL.md is excluded by !references/**
  • references/ai-chat/src/trigger/skills/time-utils/references/timezones.txt is excluded by !references/**
  • references/ai-chat/src/trigger/skills/time-utils/scripts/add.sh is excluded by !references/**
  • references/ai-chat/src/trigger/skills/time-utils/scripts/now.sh is excluded by !references/**
  • references/ai-chat/src/trigger/stress-emit.ts is excluded by !references/**
  • references/ai-chat/src/trigger/test-chat.test.ts is excluded by !references/**
  • references/ai-chat/src/trigger/test-chat.ts is excluded by !references/**
  • references/ai-chat/trigger.config.ts is excluded by !references/**
  • references/ai-chat/tsconfig.json is excluded by !references/**
  • references/ai-chat/vitest.config.ts is excluded by !references/**
  • references/hello-world/src/trigger/chatAgent.ts is excluded by !references/**
  • references/hello-world/src/trigger/triggerAndSubscribe.ts is excluded by !references/**
📒 Files selected for processing (19)
  • .changeset/ai-tool-helpers.md
  • .changeset/mcp-agent-chat-sessions.md
  • .claude/review-guides/chat-agent-sessions-row-agnostic.md
  • .claude/rules/package-installation.md
  • packages/cli-v3/src/build/buildWorker.ts
  • packages/cli-v3/src/build/bundleSkills.ts
  • packages/cli-v3/src/dev/devSession.ts
  • packages/cli-v3/src/dev/taskRunProcessPool.ts
  • packages/cli-v3/src/entryPoints/dev-index-worker.ts
  • packages/cli-v3/src/entryPoints/dev-run-controller.ts
  • packages/cli-v3/src/entryPoints/dev-run-worker.ts
  • packages/cli-v3/src/entryPoints/managed-index-controller.ts
  • packages/cli-v3/src/entryPoints/managed-index-worker.ts
  • packages/cli-v3/src/entryPoints/managed-run-worker.ts
  • packages/cli-v3/src/mcp/config.ts
  • packages/cli-v3/src/mcp/tools.ts
  • packages/cli-v3/src/mcp/tools/agentChat.ts
  • packages/cli-v3/src/mcp/tools/agents.ts
  • packages/cli-v3/src/mcp/tools/tasks.ts
✅ Files skipped from review due to trivial changes (5)
  • packages/cli-v3/src/mcp/tools/tasks.ts
  • .changeset/mcp-agent-chat-sessions.md
  • .claude/rules/package-installation.md
  • packages/cli-v3/src/entryPoints/managed-index-controller.ts
  • packages/cli-v3/src/mcp/tools/agents.ts
🚧 Files skipped from review as they are similar to previous changes (13)
  • packages/cli-v3/src/entryPoints/managed-run-worker.ts
  • packages/cli-v3/src/mcp/config.ts
  • packages/cli-v3/src/entryPoints/managed-index-worker.ts
  • .changeset/ai-tool-helpers.md
  • packages/cli-v3/src/dev/devSession.ts
  • packages/cli-v3/src/entryPoints/dev-index-worker.ts
  • packages/cli-v3/src/mcp/tools.ts
  • packages/cli-v3/src/build/buildWorker.ts
  • packages/cli-v3/src/entryPoints/dev-run-worker.ts
  • packages/cli-v3/src/dev/taskRunProcessPool.ts
  • packages/cli-v3/src/build/bundleSkills.ts
  • packages/cli-v3/src/mcp/tools/agentChat.ts
  • packages/cli-v3/src/entryPoints/dev-run-controller.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 8)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: typecheck / typecheck
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
🪛 LanguageTool
.claude/review-guides/chat-agent-sessions-row-agnostic.md

[grammar] ~26-~26: Ensure spelling is correct
Context: ...s used to build the S2 stream path, the waitpoint cache key, and the JWT resource set — s...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~97-~97: Ensure spelling is correct
Context: .... **Question to ask:** what fires the waitpoint? An agent's session.in.wait()` register...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[style] ~140-~140: To elevate your writing, try using an alternative expression here.
Context: ...ne chatId converge to one row). The row matters for downstream metadata + listing, not ...

(MATTERS_RELEVANT)


[grammar] ~156-~156: Ensure spelling is correct
Context: ...unctionally either ID works (row lookup canonicalises), but the doc text is now out of date —...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~182-~182: Ensure spelling is correct
Context: ...port itself never puts it in a URL or a waitpoint key. The sendMessages path is worth ...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~197-~197: Ensure spelling is correct
Context: ...he upsert, swap addressing identifiers, optionalise the friendlyId. If you've read `chat.ts...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🔇 Additional comments (1)
.claude/review-guides/chat-agent-sessions-row-agnostic.md (1)

1-288: LGTM!


Walkthrough

This PR adds comprehensive session-stream infrastructure, skill bundling, and MCP agent tooling. It documents the session migration strategy via changesets and a row-agnostic review guide; implements skill discovery and bundling (reading SKILL.md frontmatter, copying directories into .trigger/skills/{id}/); improves pooled process management by detecting OOM failures and force-killing affected processes; bootstraps session stream managers in dev and managed worker entrypoints; and introduces four new MCP tools for listing agents, starting chats, sending messages (with SSE streaming and upgrade handling), and closing chats.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding an ai-chat reference project and MCP agent-chat tooling. It is specific, concise, and directly related to the primary additions in the changeset.
Description check ✅ Passed The PR description is largely complete with summary, design rationale, test plan, and stack information, though it does not fill all template sections (missing issue reference and screenshots).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/ai-chat-reference-and-cli

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

devin-ai-integration[bot]

This comment was marked as resolved.

@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from ecfac76 to 7ee523e Compare May 11, 2026 19:01
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 882544c to 5baac29 Compare May 11, 2026 19:01
@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from 7ee523e to fdc61c6 Compare May 12, 2026 08:23
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 5baac29 to e16efbb Compare May 12, 2026 08:23
@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from fdc61c6 to 96700b1 Compare May 12, 2026 08:35
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from e16efbb to f4a7923 Compare May 12, 2026 08:35
@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from 96700b1 to 482d752 Compare May 12, 2026 08:40
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from f4a7923 to 04b98af Compare May 12, 2026 08:40
@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from 482d752 to 920e876 Compare May 12, 2026 08:46
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 04b98af to 417344a Compare May 12, 2026 08:46
@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from 920e876 to d96e2f7 Compare May 12, 2026 08:52
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 417344a to 43fde3f Compare May 12, 2026 08:52
@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from d96e2f7 to 3256f42 Compare May 12, 2026 09:44
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 43fde3f to c27cef9 Compare May 12, 2026 09:44
@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from 3256f42 to 220b33c Compare May 12, 2026 09:46
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from c27cef9 to 48f030a Compare May 12, 2026 09:47
@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from 220b33c to 067109f Compare May 12, 2026 09:48
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 48f030a to 3c71eeb Compare May 12, 2026 09:49
@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from 067109f to c1f6db7 Compare May 12, 2026 09:52
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 3c71eeb to 866b175 Compare May 12, 2026 09:52
@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from c1f6db7 to f75bcd8 Compare May 12, 2026 10:02
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 866b175 to 2d9bcdb Compare May 12, 2026 10:02
@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from f75bcd8 to 40a3dff Compare May 12, 2026 10:07
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 2d9bcdb to d9fa1be Compare May 12, 2026 10:07
@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from 40a3dff to 1748445 Compare May 12, 2026 10:16
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from d9fa1be to b7ed332 Compare May 12, 2026 10:16
@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from f5e3067 to 6a1e9af Compare May 14, 2026 11:06
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from fef74f4 to 343c204 Compare May 14, 2026 11:06
devin-ai-integration[bot]

This comment was marked as resolved.

@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from 6a1e9af to 04e1747 Compare May 14, 2026 12:13
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 343c204 to 480c5ea Compare May 14, 2026 12:13
@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from 04e1747 to 2a7d030 Compare May 14, 2026 12:30
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch 2 times, most recently from 8954526 to 289ab08 Compare May 14, 2026 12:32
devin-ai-integration[bot]

This comment was marked as resolved.

ericallam added a commit that referenced this pull request May 14, 2026
…3542)

## Summary

A `/sessions` dashboard for inspecting durable Sessions, an `AGENT` /
`SCHEDULED` task-kind filter for the runs list, and the server-side
hardening (rate-limit exemption for packets, retry-with-backoff on
stream appends, typed too-large-chunk error) that the `chat.agent`
runtime in #3543 needs. Builds on the Sessions primitive shipped in
#3417.

## Design

The Sessions list + detail routes mirror the run inspector pattern.
`TaskTriggerSource` gains `AGENT` and `SCHEDULED` values, persisted on
`BackgroundWorker.taskKind` and `TaskRun.taskKind` (plus a matching
Clickhouse column), so the runs list can filter by kind.

New `@trigger.dev/core` modules — `sessionStreams`, `inputStreams`, a
`sessionStreamInstance` for realtime streams, and the
`realtime-streams-api` / `session-streams-api` surfaces — expose the
typed shapes that chat.agent will use to drive `session.out`.
`ChatChunkTooLargeError` lets the runtime drop oversized chunks with a
typed surface instead of failing the run. `s2Append` retries transient
failures with exponential backoff. `/api/v[12]/packets/*` is exempt from
customer rate limits so chat snapshot reads and writes don't get
throttled under load.

## Stack

Part of a 4-PR stack. Merge bottom-up.

1. **This PR** (#3542) → `main`
2. #3543#3542 — `chat.agent` runtime + browser transport
3. #3545#3543 — agent-view dashboard
4. #3546#3545 — ai-chat reference + MCP tooling

Replaces #3173 (closed).

<!-- GitButler Footer Boundary Top -->
---
This is **part 5 of 5 in a stack** made with GitButler:
- <kbd>&nbsp;5&nbsp;</kbd> #3612
- <kbd>&nbsp;4&nbsp;</kbd> #3546
- <kbd>&nbsp;3&nbsp;</kbd> #3545
- <kbd>&nbsp;2&nbsp;</kbd> #3543
- <kbd>&nbsp;1&nbsp;</kbd> #3542 👈 
<!-- GitButler Footer Boundary Bottom -->
@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from 2a7d030 to 5fa5d3d Compare May 14, 2026 12:44
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 289ab08 to e373556 Compare May 14, 2026 12:45
@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from 5fa5d3d to f8d5198 Compare May 14, 2026 13:10
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from e373556 to 55d9543 Compare May 14, 2026 13:11
@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from f8d5198 to a08c3a4 Compare May 14, 2026 14:11
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 55d9543 to 2cd4c8f Compare May 14, 2026 14:11
devin-ai-integration[bot]

This comment was marked as resolved.

@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from a08c3a4 to dc82bb6 Compare May 14, 2026 14:31
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 2cd4c8f to d3f90d7 Compare May 14, 2026 14:31
@ericallam ericallam force-pushed the feature/agent-view-dashboard branch from dc82bb6 to 12b4525 Compare May 14, 2026 14:58
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from d3f90d7 to 43e9f21 Compare May 14, 2026 14:58
github-advanced-security[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (2)
packages/cli-v3/src/entryPoints/dev-run-worker.ts (1)

358-387: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Add standardSessionStreamManager.reset() to lifecycle cleanup.

The resetExecutionEnvironment() function resets other stream managers (standardRealtimeStreamsManager, standardInputStreamManager) but omits the session stream manager. Without this reset, session stream state will persist across worker reuses, potentially leaking handlers, buffered records, and other internal state into subsequent task executions.

🔧 Suggested fix
  standardRealtimeStreamsManager.reset();
  standardInputStreamManager.reset();
+ standardSessionStreamManager.reset();
  waitUntilManager.reset();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/cli-v3/src/entryPoints/dev-run-worker.ts` around lines 358 - 387,
The resetExecutionEnvironment() lifecycle cleanup misses resetting the session
stream manager, allowing session state to leak between runs; inside
resetExecutionEnvironment() add a call to standardSessionStreamManager.reset()
alongside the other resets (e.g., next to
standardRealtimeStreamsManager.reset(), standardInputStreamManager.reset()) so
session handlers, buffered records, and internal state are cleared on each
worker reset.
.claude/architecture/sessions-as-run-manager.md (1)

292-294: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Design should specify explicit recursion bounds.

The pathological recursion path at line 293 lacks an explicit retry limit or backoff policy in the design. While the comment at line 301 states recursion is "bounded by run-engine's own progress," this is an implicit bound. The design spec should prescribe explicit bounds (e.g., max 3 retry attempts with exponential backoff) to guide implementation and prevent indefinite loops or stack exhaustion in edge cases.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/architecture/sessions-as-run-manager.md around lines 292 - 294, The
design currently leaves the pathological recursion in ensureRunForSession(fresh,
reason) unbounded; update the spec to require an explicit retry policy: limit
retries (e.g., maxRetries = 3) and use exponential backoff with jitter (e.g.,
baseDelay x 2^attempt) between attempts, and prefer an iterative retry loop or
tail-recursion to avoid stack growth; reference ensureRunForSession and the
“run-engine” progress dependency and state when to abort (return an
error/timeout) after maxRetries so implementations cannot recurse indefinitely.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In @.claude/architecture/sessions-as-run-manager.md:
- Around line 292-294: The design currently leaves the pathological recursion in
ensureRunForSession(fresh, reason) unbounded; update the spec to require an
explicit retry policy: limit retries (e.g., maxRetries = 3) and use exponential
backoff with jitter (e.g., baseDelay x 2^attempt) between attempts, and prefer
an iterative retry loop or tail-recursion to avoid stack growth; reference
ensureRunForSession and the “run-engine” progress dependency and state when to
abort (return an error/timeout) after maxRetries so implementations cannot
recurse indefinitely.

In `@packages/cli-v3/src/entryPoints/dev-run-worker.ts`:
- Around line 358-387: The resetExecutionEnvironment() lifecycle cleanup misses
resetting the session stream manager, allowing session state to leak between
runs; inside resetExecutionEnvironment() add a call to
standardSessionStreamManager.reset() alongside the other resets (e.g., next to
standardRealtimeStreamsManager.reset(), standardInputStreamManager.reset()) so
session handlers, buffered records, and internal state are cleared on each
worker reset.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 40ab6dd3-01f3-45c4-aee5-100b383b1308

📥 Commits

Reviewing files that changed from the base of the PR and between 6f62bc9 and ccadd9f.

⛔ Files ignored due to path filters (57)
  • .claude/scheduled_tasks.lock is excluded by !**/*.lock
  • references/ai-chat/.gitignore is excluded by !references/**
  • references/ai-chat/.nvmrc is excluded by !references/**
  • references/ai-chat/DEMO-SHORTHAND.md is excluded by !references/**
  • references/ai-chat/DEMO.md is excluded by !references/**
  • references/ai-chat/README.md is excluded by !references/**
  • references/ai-chat/next-env.d.ts is excluded by !references/**
  • references/ai-chat/next.config.ts is excluded by !references/**
  • references/ai-chat/package.json is excluded by !references/**
  • references/ai-chat/postcss.config.mjs is excluded by !references/**
  • references/ai-chat/prisma.config.ts is excluded by !references/**
  • references/ai-chat/prisma/migrations/20260305112427_init/migration.sql is excluded by !references/**
  • references/ai-chat/prisma/migrations/20260306165319_add_user_model/migration.sql is excluded by !references/**
  • references/ai-chat/prisma/migrations/20260327180000_remove_user_tool/migration.sql is excluded by !references/**
  • references/ai-chat/prisma/migrations/20260425091008_add_chat_model_and_user_github_token/migration.sql is excluded by !references/**
  • references/ai-chat/prisma/migrations/20260425121916_add_session_id_to_chat_session/migration.sql is excluded by !references/**
  • references/ai-chat/prisma/migrations/20260427053743_simplify_chat_session_for_run_manager/migration.sql is excluded by !references/**
  • references/ai-chat/prisma/migrations/migration_lock.toml is excluded by !references/**
  • references/ai-chat/prisma/reset-chats.sql is excluded by !references/**
  • references/ai-chat/prisma/schema.prisma is excluded by !references/**
  • references/ai-chat/src/app/actions.ts is excluded by !references/**
  • references/ai-chat/src/app/api/chat/route.ts is excluded by !references/**
  • references/ai-chat/src/app/chats/[chatId]/page.tsx is excluded by !references/**
  • references/ai-chat/src/app/chats/layout.tsx is excluded by !references/**
  • references/ai-chat/src/app/chats/page.tsx is excluded by !references/**
  • references/ai-chat/src/app/globals.css is excluded by !references/**
  • references/ai-chat/src/app/layout.tsx is excluded by !references/**
  • references/ai-chat/src/app/page.tsx is excluded by !references/**
  • references/ai-chat/src/components/chat-app.tsx is excluded by !references/**
  • references/ai-chat/src/components/chat-settings-context.tsx is excluded by !references/**
  • references/ai-chat/src/components/chat-sidebar-wrapper.tsx is excluded by !references/**
  • references/ai-chat/src/components/chat-sidebar.tsx is excluded by !references/**
  • references/ai-chat/src/components/chat-view.tsx is excluded by !references/**
  • references/ai-chat/src/components/chat.tsx is excluded by !references/**
  • references/ai-chat/src/lib/chat-tools-schemas.ts is excluded by !references/**
  • references/ai-chat/src/lib/chat-tools.ts is excluded by !references/**
  • references/ai-chat/src/lib/code-sandbox.ts is excluded by !references/**
  • references/ai-chat/src/lib/models.ts is excluded by !references/**
  • references/ai-chat/src/lib/pr-review-helpers.ts is excluded by !references/**
  • references/ai-chat/src/lib/pr-review-tools.ts is excluded by !references/**
  • references/ai-chat/src/lib/prisma.ts is excluded by !references/**
  • references/ai-chat/src/trigger/chat-client-test.ts is excluded by !references/**
  • references/ai-chat/src/trigger/chat-tools.ts is excluded by !references/**
  • references/ai-chat/src/trigger/chat.ts is excluded by !references/**
  • references/ai-chat/src/trigger/pr-review.ts is excluded by !references/**
  • references/ai-chat/src/trigger/skills/time-utils/SKILL.md is excluded by !references/**
  • references/ai-chat/src/trigger/skills/time-utils/references/timezones.txt is excluded by !references/**
  • references/ai-chat/src/trigger/skills/time-utils/scripts/add.sh is excluded by !references/**
  • references/ai-chat/src/trigger/skills/time-utils/scripts/now.sh is excluded by !references/**
  • references/ai-chat/src/trigger/stress-emit.ts is excluded by !references/**
  • references/ai-chat/src/trigger/test-chat.test.ts is excluded by !references/**
  • references/ai-chat/src/trigger/test-chat.ts is excluded by !references/**
  • references/ai-chat/trigger.config.ts is excluded by !references/**
  • references/ai-chat/tsconfig.json is excluded by !references/**
  • references/ai-chat/vitest.config.ts is excluded by !references/**
  • references/hello-world/src/trigger/chatAgent.ts is excluded by !references/**
  • references/hello-world/src/trigger/triggerAndSubscribe.ts is excluded by !references/**
📒 Files selected for processing (22)
  • .changeset/ai-tool-helpers.md
  • .changeset/mcp-agent-chat-sessions.md
  • .claude/architecture/chat-agent-sessions.md
  • .claude/architecture/sessions-as-run-manager.md
  • .claude/docs-plans/sessions-as-run-manager-docs.md
  • .claude/review-guides/chat-agent-sessions-row-agnostic.md
  • .claude/rules/package-installation.md
  • packages/cli-v3/src/build/buildWorker.ts
  • packages/cli-v3/src/build/bundleSkills.ts
  • packages/cli-v3/src/dev/devSession.ts
  • packages/cli-v3/src/dev/taskRunProcessPool.ts
  • packages/cli-v3/src/entryPoints/dev-index-worker.ts
  • packages/cli-v3/src/entryPoints/dev-run-controller.ts
  • packages/cli-v3/src/entryPoints/dev-run-worker.ts
  • packages/cli-v3/src/entryPoints/managed-index-controller.ts
  • packages/cli-v3/src/entryPoints/managed-index-worker.ts
  • packages/cli-v3/src/entryPoints/managed-run-worker.ts
  • packages/cli-v3/src/mcp/config.ts
  • packages/cli-v3/src/mcp/tools.ts
  • packages/cli-v3/src/mcp/tools/agentChat.ts
  • packages/cli-v3/src/mcp/tools/agents.ts
  • packages/cli-v3/src/mcp/tools/tasks.ts
✅ Files skipped from review due to trivial changes (3)
  • .claude/rules/package-installation.md
  • .changeset/ai-tool-helpers.md
  • .changeset/mcp-agent-chat-sessions.md
🚧 Files skipped from review as they are similar to previous changes (14)
  • packages/cli-v3/src/mcp/tools/tasks.ts
  • packages/cli-v3/src/entryPoints/managed-index-controller.ts
  • packages/cli-v3/src/entryPoints/dev-index-worker.ts
  • packages/cli-v3/src/dev/taskRunProcessPool.ts
  • packages/cli-v3/src/mcp/tools.ts
  • packages/cli-v3/src/entryPoints/managed-index-worker.ts
  • packages/cli-v3/src/build/buildWorker.ts
  • packages/cli-v3/src/mcp/config.ts
  • packages/cli-v3/src/entryPoints/managed-run-worker.ts
  • packages/cli-v3/src/mcp/tools/agentChat.ts
  • packages/cli-v3/src/dev/devSession.ts
  • packages/cli-v3/src/mcp/tools/agents.ts
  • packages/cli-v3/src/entryPoints/dev-run-controller.ts
  • packages/cli-v3/src/build/bundleSkills.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (25)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: audit
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Use types over interfaces for TypeScript
Avoid using enums; prefer string unions or const objects instead

**/*.{ts,tsx}: Import from @trigger.dev/core subpaths only, never from the root. Subpath imports must be used to maintain proper module boundaries.
When writing Trigger.dev tasks, always import from @trigger.dev/sdk. Never use @trigger.dev/sdk/v3 or deprecated client.defineJob.
Prisma is version 6.14.0. Use the Prisma client from internal-packages/database for all database operations.
For ClickHouse client, schema migrations, and analytics queries, use internal-packages/clickhouse.

Files:

  • packages/cli-v3/src/entryPoints/dev-run-worker.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use function declarations instead of default exports

Add crumbs as you write code — not just when debugging. Mark lines with // @Crumbs or wrap blocks in `// `#region` `@crumbs. They stay on the branch throughout development and are stripped by agentcrumbs strip before merge.

Files:

  • packages/cli-v3/src/entryPoints/dev-run-worker.ts
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/otel-metrics.mdc)

**/*.ts: When creating or editing OTEL metrics (counters, histograms, gauges), ensure metric attributes have low cardinality by using only enums, booleans, bounded error codes, or bounded shard IDs
Do not use high-cardinality attributes in OTEL metrics such as UUIDs/IDs (envId, userId, runId, projectId, organizationId), unbounded integers (itemCount, batchSize, retryCount), timestamps (createdAt, startTime), or free-form strings (errorMessage, taskName, queueName)
When exporting OTEL metrics via OTLP to Prometheus, be aware that the exporter automatically adds unit suffixes to metric names (e.g., 'my_duration_ms' becomes 'my_duration_ms_milliseconds', 'my_counter' becomes 'my_counter_total'). Account for these transformations when writing Grafana dashboards or Prometheus queries

Files:

  • packages/cli-v3/src/entryPoints/dev-run-worker.ts
packages/cli-v3/src/entryPoints/**/*

📄 CodeRabbit inference engine (packages/cli-v3/CLAUDE.md)

Code in src/entryPoints/ runs inside customer containers and is a different runtime environment from the CLI - changes affect deployed task execution directly

Files:

  • packages/cli-v3/src/entryPoints/dev-run-worker.ts
**/*.{ts,tsx,js,jsx,json,md,css,scss}

📄 CodeRabbit inference engine (AGENTS.md)

Code formatting is enforced using Prettier. Run pnpm run format before committing

Files:

  • packages/cli-v3/src/entryPoints/dev-run-worker.ts
packages/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

When modifying any public package (packages/* or integrations/*), add a changeset using pnpm run changeset:add. Default to patch for bug fixes and minor changes; confirm with maintainers before selecting minor; never select major without explicit approval.

Files:

  • packages/cli-v3/src/entryPoints/dev-run-worker.ts
🧠 Learnings (2)
📚 Learning: 2026-03-22T13:26:12.060Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3244
File: apps/webapp/app/components/code/TextEditor.tsx:81-86
Timestamp: 2026-03-22T13:26:12.060Z
Learning: In the triggerdotdev/trigger.dev codebase, do not flag `navigator.clipboard.writeText(...)` calls for `missing-await`/`unhandled-promise` issues. These clipboard writes are intentionally invoked without `await` and without `catch` handlers across the project; keep that behavior consistent when reviewing TypeScript/TSX files (e.g., usages like in `apps/webapp/app/components/code/TextEditor.tsx`).

Applied to files:

  • packages/cli-v3/src/entryPoints/dev-run-worker.ts
📚 Learning: 2026-03-22T19:24:14.403Z
Learnt from: matt-aitken
Repo: triggerdotdev/trigger.dev PR: 3187
File: apps/webapp/app/v3/services/alerts/deliverErrorGroupAlert.server.ts:200-204
Timestamp: 2026-03-22T19:24:14.403Z
Learning: In the triggerdotdev/trigger.dev codebase, webhook URLs are not expected to contain embedded credentials/secrets (e.g., fields like `ProjectAlertWebhookProperties` should only hold credential-free webhook endpoints). During code review, if you see logging or inclusion of raw webhook URLs in error messages, do not automatically treat it as a credential-leak/secrets-in-logs issue by default—first verify the URL does not contain embedded credentials (for example, no username/password in the URL, no obvious secret/token query params or fragments). If the URL is credential-free per this project’s conventions, allow the logging.

Applied to files:

  • packages/cli-v3/src/entryPoints/dev-run-worker.ts
🪛 LanguageTool
.claude/architecture/sessions-as-run-manager.md

[grammar] ~8-~8: Ensure spelling is correct
Context: ... The previous branch made chatId (the externalId) the universal addressing string and ma...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[style] ~17-~17: ‘whether or not’ might be wordy. Consider a shorter alternative.
Context: ...dent — it appends to S2 successfully whether or not the run is alive. The transport's "n...

(EN_WORDINESS_PREMIUM_WHETHER_OR_NOT)


[style] ~418-~418: To elevate your writing, try using more formal phrasing here.
Context: ...nd-continue` returns conflict, agent v1 keeps running, processes message, retries upgrade l...

(CONTINUE_TO_VB)


[style] ~511-~511: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...oads incompatible with the new version. Probably defer — chat.agent contract is stabl...

(REP_PROBABLY)

.claude/docs-plans/sessions-as-run-manager-docs.md

[style] ~93-~93: To form a complete sentence, be sure to include a subject or ‘there’.
Context: ...hboard. ### ai-chat/compaction.mdx - Should be untouched (compaction lives inside `...

(MISSING_IT_THERE)


[style] ~96-~96: To form a complete sentence, be sure to include a subject or ‘there’.
Context: .... ### ai-chat/pending-messages.mdx - Should be untouched (steering messages flow th...

(MISSING_IT_THERE)


[grammar] ~126-~126: Ensure spelling is correct
Context: ...AndContinueSession(server-to-server), webapp atomically swapsSession.currentRunId`...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[style] ~137-~137: To form a complete sentence, be sure to include a subject.
Context: ...patterns/branching-conversations.mdx` - Should be mostly unchanged. Branching is a cus...

(MISSING_IT_THERE)


[style] ~143-~143: To form a complete sentence, be sure to include a subject.
Context: ...-chat/patterns/human-in-the-loop.mdx- Should be unchanged. ###ai-chat/patterns/sk...

(MISSING_IT_THERE)


[style] ~146-~146: To form a complete sentence, be sure to include a subject.
Context: ...d. ### ai-chat/patterns/skills.mdx - Should be unchanged. ## NEW page: upgrade gui...

(MISSING_IT_THERE)

.claude/review-guides/chat-agent-sessions-row-agnostic.md

[grammar] ~26-~26: Ensure spelling is correct
Context: ...s used to build the S2 stream path, the waitpoint cache key, and the JWT resource set — s...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~97-~97: Ensure spelling is correct
Context: .... **Question to ask:** what fires the waitpoint? An agent's session.in.wait()` register...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[style] ~140-~140: To elevate your writing, try using an alternative expression here.
Context: ...ne chatId converge to one row). The row matters for downstream metadata + listing, not ...

(MATTERS_RELEVANT)


[grammar] ~156-~156: Ensure spelling is correct
Context: ...unctionally either ID works (row lookup canonicalises), but the doc text is now out of date —...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~182-~182: Ensure spelling is correct
Context: ...port itself never puts it in a URL or a waitpoint key. The sendMessages path is worth ...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~197-~197: Ensure spelling is correct
Context: ...he upsert, swap addressing identifiers, optionalise the friendlyId. If you've read `chat.ts...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🪛 markdownlint-cli2 (0.22.1)
.claude/architecture/chat-agent-sessions.md

[warning] 72-72: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 102-102: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 155-155: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 181-181: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 204-204: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 231-231: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 254-254: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 288-288: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 394-394: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 405-405: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

.claude/architecture/sessions-as-run-manager.md

[warning] 59-59: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 473-473: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

.claude/docs-plans/sessions-as-run-manager-docs.md

[warning] 343-343: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (5)
packages/cli-v3/src/entryPoints/dev-run-worker.ts (2)

37-37: LGTM!

Also applies to: 65-65


191-197: LGTM!

.claude/architecture/chat-agent-sessions.md (1)

353-357: Stale follow-up item references already-migrated MCP chat tooling.

This section lists packages/cli-v3/src/mcp/tools/agentChat.ts as an unmigrated legacy consumer, but the PR stack context explicitly includes "MCP agent discovery & chat tools" (layer 7) with implementations for starting chats, sending messages, and closing chats. Please remove this entry from the "Known follow-ups" list or mark the section as historical snapshot-only.

.claude/docs-plans/sessions-as-run-manager-docs.md (1)

9-10: ⚡ Quick win

SessionRun is treated as guaranteed here but optional/deferred in the architecture spec.

Line 9 states the Session "tracks every run it ever triggered in a SessionRun audit table," but the companion architecture spec (sessions-as-run-manager.md lines 118-133) explicitly marks SessionRun as "Optional historical join (defer to v1.1)" and "Not strictly needed for v1." This inconsistency appears in multiple places (lines 90, 127, 317-318). Please use conditional language (e.g., "may track", "if the SessionRun table is present") to align with the architecture spec's deferred/optional treatment.

.claude/review-guides/chat-agent-sessions-row-agnostic.md (1)

1-288: LGTM!

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Top of the chat.agent stack: a full Next.js reference project that
exercises chat.agent end-to-end, plus the CLI MCP tools that drive
agent runs from Claude Code / Cursor / etc.

references/ai-chat:
- Full Next.js app with prisma persistence, multi-chat sidebar,
  per-chat model picker, debug panel, tool examples, smoke tests
- Reference tools: getCurrentTime, searchHackerNews, createGithubIssue,
  PR review helpers, code sandbox
- chat-client-test orchestrator for concurrent-send stress
- references/hello-world chatAgent + triggerAndSubscribe examples

CLI MCP tooling for chat.agent:
- mcp/tools/agentChat.ts (start_agent_chat, send_agent_message,
  close_agent_chat)
- mcp/tools/agents.ts + tasks.ts (list agents, agent run details)
- dev-run-controller OOM kill + taskRunProcessPool tweaks
- dev/managed entry-point hooks for skills bundling
- buildWorker + bundleSkills (agent skills support)

Includes ai-tool-helpers + mcp-agent-chat-sessions changesets, plus
the streamdown@2 patch and pnpm-lock reconciliation.

(Will be renamed to feature/ai-chat-reference-and-cli before push.)

fix(cli): preserve lastEventId after sendMessage fallback to avoid stale turn-complete replay
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.

3 participants