feat(webapp): agent-view dashboard for chat.agent runs (4/5)#3545
feat(webapp): agent-view dashboard for chat.agent runs (4/5)#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 |
|
| 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
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.
a4bd26a to
76e3cec
Compare
95f6dd2 to
234ad0c
Compare
Layer 4 of 5 in the chat.agent stack split
Dashboard surfaces for inspecting and debugging
chat.agentruns.Depends on the existing Sessions primitive on main, plus the chat-ready hardening (L1), the chat.agent runtime (L2), and the browser chat transport (L3).
Targets
feature/chat-client-transport— merge after #3544Run inspector — chat-aware
AgentView+AgentMessageView(run inspector tab for chat.agent runs)AIChatMessages+AISpanDetails+types.ts(per-span chat messagerendering, tool-call / tool-output handling)
PromptSpanDetails(gen_ai.*span detail panel)StreamdownRenderer+shikiTheme(markdown renderer with shikihighlighting and v2 patch)
useAutoScrollToBottomhookPlayground UI (interactive chat.agent debugger)
/playgroundindex +/playground/$agentParamroutes/agentsroute +AgentListPresenterPlaygroundPresenter(per-org basin variants, clientData wiring)AIPayloadTabContentfor the test panelNavigation + theming
SideMenulinks for Agents and PlaygroundBlankStatePanelscopy updatesstreamdown@2dep inapps/webapp/package.jsonIncludes
agent-view-sessions,playground-trigger-config-fields,run-agent-view, andstreamdown-v2-upgradeserver-changes entries.Stack