chore(frontend): drop config view options; move response channel to Session Inspector - #5399
Conversation
…ession inspector Accordion is the only supported agent config-panel layout, so remove the accordion/tabs/cards "View" selector from the playground settings cog and delete the now-dead tabs/cards render paths, the persisted layout atom, and the inline section bodies (modelHarnessInline/advancedInline) that only fed the tabs view. Move the stream/batch response-channel toggle out of the global cog menu into a new per-session "Response" lens in the Session Inspector. The channel is now a persisted per-session preference (agentChannelModeAtomFamily) that buildAgentRequest reads by session_id, instead of a single global atom. The settings cog now hides itself when its menu is empty (only the flag-gated virtualization spike remains).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
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: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdds a session-scoped stream/batch response preference exposed through a new Inspector lens, updates request negotiation, removes the old Playground response settings, and simplifies agent configuration sections to an accordion-only layout. ChangesResponse transport selection
Accordion-only agent configuration
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Inspector
participant ResponseLens
participant SessionChannelState
participant AgentRequest
participant Invoke
Inspector->>ResponseLens: render response controls
ResponseLens->>SessionChannelState: update session mode
AgentRequest->>SessionChannelState: read session mode
AgentRequest->>Invoke: send stream or batch Accept header
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/AgentTemplateControl.tsx (1)
716-724: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winResidual dead
contentfor onOpen-driven sections.
onOpenis set on both the "model-harness" (Line 721) and "advanced" (Line 847) descriptors, and perConfigAccordionSectionPropsthis makes the header act as a drawer trigger where "the body (children) is not rendered; a right chevron signals "opens" rather than "expands"". That means thecontent: mh.modelHarnessDrawerBody/content: mh.advancedDrawerBodyvalues assigned here are never actually rendered as children (they're superseded by the separateModelHarnessSectionDrawerBodymounted in theSectionDrawers at Lines 985 and 1008). Since this PR's whole purpose is pruning unused config-surface paths, consider droppingcontentfrom these two descriptors (making the field optional in the type) rather than leaving an unused live-instance reference threaded through.♻️ Proposed cleanup
mh.hasModelOrHarness && { key: "model-harness", icon: <Cpu size={16} />, title: "Model & harness", summary: mh.modelSummary, indicator: headerIndicator("model-harness"), defaultOpen: true, onOpen: () => openSectionDrawer("model-harness"), - content: mh.modelHarnessDrawerBody, },mh.hasAdvanced && { key: "advanced", icon: <SlidersHorizontal size={16} />, title: "Advanced", indicator: headerIndicator("advanced"), defaultOpen: false, summary: mh.advancedSummary, onOpen: () => openSectionDrawer("advanced"), - content: mh.advancedDrawerBody, },defaultOpen?: boolean onOpen?: () => void - content: React.ReactNode + content?: React.ReactNode }[]Please confirm
ConfigAccordionSection's implementation indeed ignoreschildrenwheneveronOpenis passed before applying, since only its prop-type documentation was available here.Also applies to: 840-850
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 48228e3b-19ba-4733-ab04-0ec16dfa7f28
📒 Files selected for processing (16)
web/oss/src/components/AgentChatSlice/components/Inspector/LensBody.tsxweb/oss/src/components/AgentChatSlice/components/Inspector/LensRail.tsxweb/oss/src/components/AgentChatSlice/components/Inspector/lenses/ResponseLens.tsxweb/oss/src/components/AgentChatSlice/components/Inspector/state.tsweb/oss/src/components/Playground/Components/PlaygroundHeader/index.tsxweb/packages/agenta-entity-ui/src/DrillInView/SchemaControls/AgentTemplateControl.tsxweb/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useModelHarness.tsxweb/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplateLayout.tsweb/packages/agenta-entity-ui/src/DrillInView/SchemaControls/index.tsweb/packages/agenta-entity-ui/src/DrillInView/index.tsweb/packages/agenta-playground/src/index.tsweb/packages/agenta-playground/src/state/execution/agentRequest.tsweb/packages/agenta-playground/src/state/execution/channelMode.tsweb/packages/agenta-playground/src/state/execution/index.tsweb/packages/agenta-playground/src/state/index.tsweb/packages/agenta-playground/tests/unit/agentRequest.test.ts
💤 Files with no reviewable changes (4)
- web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplateLayout.ts
- web/packages/agenta-entity-ui/src/DrillInView/index.ts
- web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/index.ts
- web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useModelHarness.tsx
Railway Preview Environment
|
mmabrouk
left a comment
There was a problem hiding this comment.
Thanks @ardaerzin
Two small issues:
- The inspect icon should show and collapse. Right now it just shows
- There is a UI bug (see video). Probably due to the tooltip. I think it was there before, so maybe out of scope here.
https://github.com/user-attachments/assets/ced8f32d-6f04-445d-8f81-1040bd7148fd
…nspect button - AgentTemplateControl: the model-harness and advanced sections pass `onOpen`, so ConfigAccordionSection renders them as drawer-openers and never mounts their `content`. Drop the two dead `content` assignments and make the descriptor field optional. The drawer bodies stay (used by the draft ModelHarnessSectionDrawerBody). - Inspect-session button now toggles: clicking again collapses the docked Inspector instead of only opening it. Add toggleInspectorSessionAtom next to the open/close atoms and reflect the open state on the button (active style + aria-pressed).
Why
The agent config panel only ships one layout — the accordion. The accordion/tabs/cards View selector in the playground settings cog was dead weight: two of the three options were unfinished alternates, and their render paths, the persisted layout atom, and the tabs-only inline section bodies were all dead code behind a preference nobody needs to set.
Separately, the stream/batch response-channel toggle lived in that same global cog menu, so it applied to every session at once. It's really a per-conversation transport preference, so it belongs with the session — not as a global switch.
What
1. Remove the config View options (accordion / tabs / cards)
Viewgroup from the playground settings cog.tabsandcardsrender branches inAgentTemplateControl; the accordion is now rendered unconditionally.agentTemplateLayout.ts) and its barrel re-exports.modelHarnessInline/advancedInline) and theinlineContentdescriptor field that only fed the tabs view.2. Move stream/batch to the Session Inspector as a per-session setting
agentChannelModeAtomwithagentChannelModeAtomFamily(sessionId), backed by a persisted per-session map — the choice now survives reloads and is scoped to the conversation.buildAgentRequestreads the mode bysession_id(already in scope) to set theAcceptheader.Responsegroup from the cog; the cog now hides itself when its menu is empty (only the flag-gated virtualization spike can populate it).Before / After
Testing
@agenta/entity-uiand@agenta/playgroundtypecheck clean (tsc --noEmit).agentRequestunit suite: 32/32 pass (updated to the per-session family).pnpm lint-fixclean across all packages.