feat(webapp): agent-view dashboard for chat.agent runs (3/4)#3545
feat(webapp): agent-view dashboard for chat.agent runs (3/4)#3545ericallam wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
🦋 Changeset detectedLatest commit: 8d8a1a6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 29 packages
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 |
| await prisma.playgroundConversation.updateMany({ | ||
| where: { | ||
| chatId, | ||
| runtimeEnvironmentId: environment.id, | ||
| }, | ||
| data: { | ||
| ...(messagesData ? { messages: messagesData as any } : {}), | ||
| ...(lastEventId ? { lastEventId } : {}), | ||
| ...titleUpdate, | ||
| }, | ||
| }); |
There was a problem hiding this comment.
🚩 Playground save intent missing userId filter (inconsistent with delete)
The save intent at resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.playground.action.tsx:274 uses updateMany with { chatId, runtimeEnvironmentId } but does not include userId in the where clause. In contrast, the delete intent at line 295 correctly filters by userId. This means any authenticated user with access to the same project/environment could theoretically overwrite another user's conversation messages if they knew the chatId. In practice this is mitigated by chatIds being client-generated UUIDs (extremely hard to guess), but the inconsistency weakens defense-in-depth. Adding userId to the save query would align with the delete intent's authorization model.
Was this helpful? React with 👍 or 👎 to provide feedback.
| const bucketKeys: string[] = []; | ||
| for (let i = 0; i < 24; i++) { | ||
| const h = new Date(startHour.getTime() + i * 3600_000); | ||
| bucketKeys.push(h.toISOString().slice(0, 13).replace("T", " ") + ":00:00"); | ||
| } |
There was a problem hiding this comment.
🚩 Sparkline bucket key format must match ClickHouse DateTime string representation
In AgentListPresenter.server.ts:268, bucket keys are generated as h.toISOString().slice(0, 13).replace('T', ' ') + ':00:00' (e.g., '2024-01-15 14:00:00'). These are used to look up values from ClickHouse rows keyed by toStartOfHour(created_at). The match depends on the ClickHouse client returning DateTime values in the exact same YYYY-MM-DD HH:MM:SS format. This works with the default ClickHouse DateTime string representation, but if the client or ClickHouse session is configured differently (e.g., ISO 8601 with T separator, or with timezone suffix), the keys won't match and all sparklines will show zeros. The schema uses z.string() so there's no format normalization.
Was this helpful? React with 👍 or 👎 to provide feedback.
a60187c to
172b7c3
Compare
ecfac76 to
7ee523e
Compare
172b7c3 to
a63e60a
Compare
7ee523e to
fdc61c6
Compare
a63e60a to
ce861fb
Compare
fdc61c6 to
96700b1
Compare
ce861fb to
dc686d8
Compare
96700b1 to
482d752
Compare
dc686d8 to
6c3490c
Compare
482d752 to
920e876
Compare
6c3490c to
9d26e60
Compare
920e876 to
d96e2f7
Compare
9d26e60 to
b971910
Compare
d96e2f7 to
3256f42
Compare
b971910 to
fa95095
Compare
3256f42 to
220b33c
Compare
fa95095 to
dc95b98
Compare
220b33c to
067109f
Compare
dc95b98 to
abb2cab
Compare
067109f to
c1f6db7
Compare
abb2cab to
3233503
Compare
c1f6db7 to
f75bcd8
Compare
3233503 to
3b68877
Compare
f75bcd8 to
40a3dff
Compare
3b68877 to
cac4fc5
Compare
40a3dff to
1748445
Compare
cac4fc5 to
a4bd26a
Compare
1748445 to
95f6dd2
Compare
a4bd26a to
76e3cec
Compare
95f6dd2 to
234ad0c
Compare
Dashboard surfaces for inspecting and debugging chat.agent runs. Depends on the Sessions primitive (L1) and chat.agent runtime (L2+L3). Run inspector — chat-aware: - AgentView + AgentMessageView (run inspector tab for chat.agent runs) - AIChatMessages + AISpanDetails + types.ts (per-span chat message rendering, tool-call/tool-output handling) - PromptSpanDetails (gen_ai.* span detail panel) - StreamdownRenderer + shikiTheme (markdown renderer with shiki highlighting and v2 patch) - useAutoScrollToBottom hook Playground UI (interactive chat.agent debugger): - /playground index + /playground/$agentParam routes - /agents route + AgentListPresenter - PlaygroundPresenter (per-org basin variants, clientData wiring) - realtime session routes for playground + run inspector chat - AI-generate-payload + AIPayloadTabContent for the test panel Navigation + theming: - SideMenu links for Agents and Playground - BlankStatePanels copy updates - tailwind config + tailwind.css storybook hooks - streamdown@2 dep in apps/webapp/package.json Includes agent-view-sessions, playground-trigger-config-fields, run-agent-view, and streamdown-v2-upgrade .server-changes.
234ad0c to
8d8a1a6
Compare
Summary
A chat-aware run inspector and a
/playgroundUI for testingchat.agenttasks interactively. Builds on #3543's runtime.Design
The run inspector grows a new tab that renders the conversation chain for any
chat.agent-kind run. It subscribes to the run's session streams, threads chat parts through a per-message renderer, and uses a shared markdown + Shiki component for code highlighting (also used by the test-payload panel).The playground is a standalone
/playgroundroute that lets you drive a deployed chat agent from the dashboard — pick a task, send messages, watch tool calls render, and see span detail on every turn. The matching/agentslist view shows all deployed agents in the project.Test plan
chat.agentrun, verify the new chat tab renders the conversation/playground, pick an agent, send a message, watch it stream/agents, verify the list reflects deployed agents in the projectStack
Part of a 4-PR stack. Merge bottom-up.
main— Sessions dashboard + chat-ready hardeningchat.agentruntime + browser transport