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.
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.
a60187c to
172b7c3
Compare
ecfac76 to
7ee523e
Compare
Layer 4 of 5 in the chat.agent stack split
Dashboard surfaces for inspecting and debugging
chat.agentruns.Depends on the Sessions primitive (L1), chat.agent runtime (L2),
and the browser chat transport (L3).
Targets
feature/chat-client-transport— merge after L3Run 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