Skip to content

chore(frontend): drop config view options; move response channel to Session Inspector - #5399

Merged
ardaerzin merged 3 commits into
release/v0.105.7from
fe-chore/remove-config-view-options
Jul 20, 2026
Merged

chore(frontend): drop config view options; move response channel to Session Inspector#5399
ardaerzin merged 3 commits into
release/v0.105.7from
fe-chore/remove-config-view-options

Conversation

@ardaerzin

Copy link
Copy Markdown
Contributor

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)

  • Delete the View group from the playground settings cog.
  • Delete the tabs and cards render branches in AgentTemplateControl; the accordion is now rendered unconditionally.
  • Delete the persisted layout atom + type + option list (agentTemplateLayout.ts) and its barrel re-exports.
  • Delete the now-orphaned inline section bodies (modelHarnessInline / advancedInline) and the inlineContent descriptor field that only fed the tabs view.

2. Move stream/batch to the Session Inspector as a per-session setting

  • Replace the global agentChannelModeAtom with agentChannelModeAtomFamily(sessionId), backed by a persisted per-session map — the choice now survives reloads and is scoped to the conversation.
  • buildAgentRequest reads the mode by session_id (already in scope) to set the Accept header.
  • Add a new Response lens to the Inspector (Timeline / Context / Runtime / Response) with two selectable option cards explaining Stream vs Batch.
  • Remove the Response group from the cog; the cog now hides itself when its menu is empty (only the flag-gated virtualization spike can populate it).

Before / After

  • Before: cog menu → View (Accordion/Tabs/Cards) + Response (Stream/Batch), both global; two unused layout renderers shipped.
  • After: no View selector, accordion-only; Stream/Batch is a per-session control in the Inspector's Response lens; cog is hidden unless the virtualization dev-spike flag is on.

Testing

  • @agenta/entity-ui and @agenta/playground typecheck clean (tsc --noEmit).
  • agentRequest unit suite: 32/32 pass (updated to the per-session family).
  • OSS: no new type errors in any touched file; pnpm lint-fix clean across all packages.

…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).
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 20, 2026
@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jul 20, 2026 6:58pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1fb65d33-d64f-4fc3-b3a8-e93c1c7279f8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds 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.

Changes

Response transport selection

Layer / File(s) Summary
Session-scoped channel state and request negotiation
web/packages/agenta-playground/src/state/execution/*, web/packages/agenta-playground/src/index.ts, web/packages/agenta-playground/src/state/index.ts, web/packages/agenta-playground/tests/unit/agentRequest.test.ts
Channel mode is persisted per session, used to select the /invoke Accept header, re-exported through package entrypoints, and covered by updated request tests.
Response lens controls
web/oss/src/components/AgentChatSlice/components/Inspector/lenses/ResponseLens.tsx
Adds stream and batch radio-style controls backed by the session channel mode atom family.
Inspector response lens wiring
web/oss/src/components/AgentChatSlice/components/Inspector/state.ts, web/oss/src/components/AgentChatSlice/components/Inspector/LensRail.tsx, web/oss/src/components/AgentChatSlice/components/Inspector/LensBody.tsx
Adds the response lens type, tab, tooltip, rendering branch, and export.
Playground response settings removal
web/oss/src/components/Playground/Components/PlaygroundHeader/index.tsx
Removes the header’s View and Response settings items and conditionally renders the settings dropdown only when items exist.

Accordion-only agent configuration

Layer / File(s) Summary
Accordion-only configuration sections
web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/AgentTemplateControl.tsx
Removes tabs/cards rendering and inline section variants so configuration sections render through the accordion path.
Model and harness drawer contract
web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useModelHarness.tsx
Removes inline model/harness and advanced bodies while retaining drawer bodies, summaries, flags, and sizing.
Layout preference export removal
web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/index.ts, web/packages/agenta-entity-ui/src/DrillInView/index.ts
Removes the deleted layout preference symbols from public re-exports.

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
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 60.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly summarizes the two main changes: removing config view options and moving response channel settings into the Session Inspector.
Description check ✅ Passed The description is detailed and directly matches the implemented changes around the layout selector, per-session channel mode, and Inspector response lens.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fe-chore/remove-config-view-options

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/AgentTemplateControl.tsx (1)

716-724: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Residual dead content for onOpen-driven sections.

onOpen is set on both the "model-harness" (Line 721) and "advanced" (Line 847) descriptors, and per ConfigAccordionSectionProps this 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 the content: mh.modelHarnessDrawerBody / content: mh.advancedDrawerBody values assigned here are never actually rendered as children (they're superseded by the separate ModelHarnessSectionDrawerBody mounted in the SectionDrawers at Lines 985 and 1008). Since this PR's whole purpose is pruning unused config-surface paths, consider dropping content from 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 ignores children whenever onOpen is 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

📥 Commits

Reviewing files that changed from the base of the PR and between 3588f13 and 8083525.

📒 Files selected for processing (16)
  • web/oss/src/components/AgentChatSlice/components/Inspector/LensBody.tsx
  • web/oss/src/components/AgentChatSlice/components/Inspector/LensRail.tsx
  • web/oss/src/components/AgentChatSlice/components/Inspector/lenses/ResponseLens.tsx
  • web/oss/src/components/AgentChatSlice/components/Inspector/state.ts
  • web/oss/src/components/Playground/Components/PlaygroundHeader/index.tsx
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/AgentTemplateControl.tsx
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useModelHarness.tsx
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplateLayout.ts
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/index.ts
  • web/packages/agenta-entity-ui/src/DrillInView/index.ts
  • web/packages/agenta-playground/src/index.ts
  • web/packages/agenta-playground/src/state/execution/agentRequest.ts
  • web/packages/agenta-playground/src/state/execution/channelMode.ts
  • web/packages/agenta-playground/src/state/execution/index.ts
  • web/packages/agenta-playground/src/state/index.ts
  • web/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

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-production-0b69.up.railway.app/w
Project agenta-oss-pr-5399
Image tag pr-5399-3446d53
Status Deployed
Railway logs Open logs
Workflow logs View workflow run
Updated at 2026-07-20T19:08:19.390Z

@mmabrouk mmabrouk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @ardaerzin
Two small issues:

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 20, 2026
…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).
@ardaerzin
ardaerzin changed the base branch from main to release/v0.105.7 July 20, 2026 18:53
@ardaerzin
ardaerzin merged commit 8b7d9f1 into release/v0.105.7 Jul 20, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files. UI UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants