Skip to content

feat(chatboxes): allow Generate with AI without required servers#2605

Merged
chelojimenez merged 1 commit into
mainfrom
persona-gen-no-required-servers
Jun 11, 2026
Merged

feat(chatboxes): allow Generate with AI without required servers#2605
chelojimenez merged 1 commit into
mainfrom
persona-gen-no-required-servers

Conversation

@chelojimenez

@chelojimenez chelojimenez commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Why

A chatbox whose attachments are all optional (or has none) showed a disabled "Generate with AI" button, and both synthetic-session routes 400ed with "Chatbox has no required servers". If the tool schemas are missing — e.g. someone just forgot to attach a required server — ICP/persona generation should still work with whatever context exists (the chatbox name), not hard-block.

What

  • ChatboxUsagePanel.tsx — removed the disabled gate (and its dead tooltip — native title doesn't even render on disabled buttons in some browsers).
  • GenerateSessionsDialog.tsx — removed the hasRequiredServers guards on the Generate action; a muted notice explains the degraded mode instead: personas are generated from the chatbox name only, sessions run without tools.
  • server/routes/web/chatbox-sessions.ts — dropped both required-servers 400s and the .min(1) on the servers schemas. No new plumbing needed: createAuthorizedManager already returns a connection-less manager for zero ids, the snapshot exporter returns an empty snapshot, prepareChatV2 tolerates an empty server list, and the simulation runner already guards zero connected servers — so simulated sessions run toolless, exactly like a real no-opt-in visitor's chat.

The optional-filtering itself is unchanged: synthetic runs still model the no-opt-in baseline, and the server-side filter still prevents a tampered body from widening the toolset.

Tests

  • New server/routes/web/__tests__/chatbox-sessions.no-required-servers.test.ts (3 tests: all-optional + empty lists on both routes, asserting the empty snapshot and label-only attachment reach generatePersonas)
  • Full server/routes/web suite: 170 passed; dialog + runner tests pass; client typecheck clean

Rollout

⚠️Depends on MCPJam/mcpjam-backend#511 deploying first. This PR makes the inspector send serverAttachment.resolvedServerNames: [], which the current backend rejects; until the backend ships, the no-required-servers path surfaces a toast error instead of a disabled button (no worse than today, but not yet functional).

🤖 Generated with Claude Code


Note

Medium Risk
Changes synthetic session and persona API validation and behavior; full end-to-end success depends on a coordinated backend deploy (mcpjam-backend#511) for empty resolvedServerNames.

Overview
Generate with AI is no longer blocked when a chatbox has only optional servers or none attached. The usage panel always opens the flow; the dialog explains degraded mode and still lets users generate personas.

On the server, generate-personas and simulate-sessions/start accept empty or all-optional server lists instead of returning 400 (Chatbox has no required servers). Zod no longer requires at least one server. With zero required servers, personas are grounded on the chatbox name and synthetic sessions run toolless, matching a no-opt-in visitor. Optional-server filtering for synthetic runs is unchanged.

New route tests cover all-optional and empty server payloads for both endpoints.

Reviewed by Cursor Bugbot for commit 11e3977. Bugbot is set up for automated code reviews on this repo. Configure here.

A chatbox whose attachments are all optional (or absent) blocked the
"Generate with AI" entry point and 400ed both synthetic-session routes
with "Chatbox has no required servers". Persona generation now degrades
gracefully: the manager comes back connection-less, the captured tool
snapshot has zero servers, and the backend grounds personas in the
chatbox name instead of a tool inventory. Simulated sessions run
toolless, exactly like a real no-opt-in visitor's chat.

- ungate the Sessions-tab button and the dialog's Generate action
- show a notice in the dialog when generating without tool context
- drop the required-servers 400s and the servers .min(1) schemas
- regression tests for all-optional and empty server lists

Requires the matching mcpjam-backend change (empty tool snapshot +
label-only serverAttachment accepted on
/session-simulation/generate-personas) to be deployed first.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@chelojimenez

Copy link
Copy Markdown
Contributor Author

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 11e39771af

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const generatePersonasSchema = z.object({
projectId: z.string().min(1),
servers: z.array(chatboxServerSchema).min(1),
servers: z.array(chatboxServerSchema),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve chatbox authorization without required servers

On the empty/all-optional path enabled here, generate-personas calls createAuthorizedManager with selectedServerIds === []; that helper returns a connection-less manager before calling /web/authorize-batch, while assertBearerToken only checks that a Bearer header exists. This means a request can reach the backend LLM persona-generation call for an arbitrary projectId/chatboxId without the Inspector route first proving the caller can access that chatbox, unlike the previous non-empty-server path. Please add an explicit chatbox/project authorization check before allowing the empty server list.

Useful? React with 👍 / 👎.

@github-actions

Copy link
Copy Markdown
Contributor

Internal preview

Preview URL: https://mcp-inspector-pr-2605.up.railway.app
Deployed commit: 95156af
PR head commit: 11e3977
Backend target: staging fallback.
Health: ✅ Convex reachable
Access is employee-only in non-production environments.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9db243db-d925-448f-b9c8-938a907da5b9

📥 Commits

Reviewing files that changed from the base of the PR and between 350177b and 11e3977.

📒 Files selected for processing (4)
  • mcpjam-inspector/client/src/components/chatboxes/ChatboxUsagePanel.tsx
  • mcpjam-inspector/client/src/components/chatboxes/GenerateSessionsDialog.tsx
  • mcpjam-inspector/server/routes/web/__tests__/chatbox-sessions.no-required-servers.test.ts
  • mcpjam-inspector/server/routes/web/chatbox-sessions.ts

Walkthrough

This PR removes server availability gates from persona and session generation. The client button and dialog no longer disable when required servers are absent. The server now accepts empty server lists in both route schemas and eliminates rejection logic in the handlers, allowing personas to be grounded in the chatbox name alone with toolless sessions. Test coverage confirms both all-optional and empty server scenarios work end-to-end.


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 and usage tips.

@chelojimenez chelojimenez merged commit 3e86dc7 into main Jun 11, 2026
12 checks passed
@chelojimenez chelojimenez deleted the persona-gen-no-required-servers branch June 11, 2026 18:24
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant