Skip to content

[Feat] Guide first-admin setup through a conversational setup session - #1823

Closed
roomote-roomote[bot] wants to merge 3 commits into
developfrom
feature/conversational-first-admin-setup-3frymp1tkofbq
Closed

[Feat] Guide first-admin setup through a conversational setup session#1823
roomote-roomote[bot] wants to merge 3 commits into
developfrom
feature/conversational-first-admin-setup-3frymp1tkofbq

Conversation

@roomote-roomote

@roomote-roomote roomote-roomote Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

​Opened on behalf of @mrubens. Follow up by mentioning @roomote-roomote, in the web UI, or in Slack.

Related issue

Implements the approved "Conversational First-Admin Setup" plan delivered via Roomote task 3frymp1tkofbq.

Why this PR exists

  • I am a maintainer / this is internal Roomote work

What changed

Once a first administrator's bootstrap is complete (authentication, inference, and a usable compute provider), the signed-in /setup wizard is replaced by a persistent conversational setup session:

  • Setup session lifecycle. A new admin-only setup.getOrCreateSession command, guarded by a dedicated advisory lock, reuses the persisted setup session or creates a visible Fast web conversation and unified session titled "Set up Roomote." The linkage lives in the existing deployment setupNewState JSON (optional setupSession metadata with a stable starter-launch batch ID, idempotent milestone timestamps, and a completion marker) — no database migration. The first turn starts from a trusted setup platform event, never a fake user message.
  • Setup-aware Fast turns. Every setup-session turn receives a trusted, structured setup snapshot (readiness facts, connected provider/repository counts, starter catalog metadata, recommendation status — never credentials) plus prompt guidance to maintain an onboarding agenda, direct credentials/OAuth to the trusted side panel, use only the hardcoded starter catalog, and continue naturally after activation.
  • New Fast-native tools. update_plan persists canonical roomote_runtime.plan transcript rows; request_user_input persists canonical request/response ACP events, ends the turn with the session in needs_input, and resumes automatically from an authenticated response endpoint with a hidden normalized answer payload; launch_setup_starter_tasks is exposed only to the active setup session (enforced at both the tool filter and the native tool bridge), resolves prompts server-side from SETUP_STARTER_TASKS, derives idempotency keys from the stable batch ID, launches through the Fast child-task path with delegation linkage, and completes setup on the first successful launch while keeping partial failures visible.
  • Structured input. AcpRequestUserInputQuestion gains backward-compatible selectionMode (single default, multiple with checkboxes and an explicit Submit) and minSelections, enforced by both UI and server; sessions render a generalized structured-input card and derive needs_input from unanswered transcript requests.
  • Setup workspace UI. /setup now renders the Fast transcript as the primary surface with the existing trusted source-control provider components in a side panel (a controlled drawer sheet on smaller screens), inline automation recommendations after activation, OAuth-return deep links that surface the connect stage, milestones scheduled exactly once, and a route transition to /sessions/{id} — the same session, now normal.
  • Legacy wizard cleanup. The communication-provider, automation-recommendations, and invoke steps are removed from the signed-in setup flow per the conversational-first plan; compute-config completion hands off to the conversational gate, bootstrap keeps its auth-provider components, and persisted setup states are untouched (unknown legacy step deep links resolve through the existing obsolete-step handling).
  • Telemetry and docs. Setup-session created, source-control connected, starter launch, first setup-launched task completed (wired into Fast child task settlement, recorded exactly once via the advisory-locked milestone), transition, and recommendation-decision events (counts and catalog IDs only, never prompts or repository content); self-hosting docs describe the new flow.

How it was tested

  • New tests: multi-select input parsing and setup-state normalization (@roomote/types), setup-only tool filtering and setup prompt guidance (@roomote/cloud-agents), real-database coverage for Fast pending-input resolution and needs_input derivation (@roomote/db), client tests for the session input card in single and multi-select modes and the updated step graph (@roomote/web), and unit tests for the once-only first-task-completed settlement milestone (@roomote/sdk).
  • Targeted suites pass: types 915, cloud-agents fast-agent 270, sdk task-runs incl. new milestone tests, db sessions/pending-input 30, web setup client 182 + server 76.
  • pnpm lint:fast, pnpm check-types:fast, pnpm knip, and the full pnpm check suite pass on this branch (the only failures in the sandbox run are two pre-existing @roomote/api Slack-workflow test cases that also fail on clean origin/develop here, plus shared-test-DB pollution artifacts).
  • Manually verified on desktop and mobile viewports against the dev deployment (screenshots below): the conversational workspace, the trusted side panel and its mobile sheet, the OAuth-return connect-stage deep link, the post-activation recommendations card on the session's /sessions/{id} route, and the normal-session chrome around it. One bounded gap: the live starter-task multi-select card could not be captured because the dev deployment's orchestration model has no credentials; its rendering is covered by client tests.

Screenshots

Desktop conversational setup workspace

Mobile source-control sheet

Post-activation recommendations and connect deep link

Setup session on its normal /sessions route with recommendations

Recommendations card interactions on the session route

Checklist

  • The PR title follows the repo convention: [Feat] Guide first-admin setup through a conversational setup session
  • This PR is small and scoped to one change — it is a single coherent feature spanning shared types, the Fast runtime, and the setup UI
  • pnpm lint and pnpm check-types pass locally (full pnpm check passes)
  • I added tests and included manual validation above
  • I removed secrets, tokens, private keys, and customer data from code, logs, and screenshots
  • If this change should appear in the changelog, I ran pnpm changeset

Replace the remaining signed-in setup wizard with a persistent Fast web
session once bootstrap (auth, inference, usable compute) is ready:

- SetupNewState gains optional setupSession metadata (session id, stable
  starter-launch batch id, idempotent milestone timestamps, completion)
  with tolerant normalization; no database migration.
- Admin-only getOrCreateSetupSession under the setup advisory lock reuses
  or creates the visible web conversation titled 'Set up Roomote.' and a
  trusted setup platform event starts the first turn with the structured
  setup snapshot injected into every setup turn.
- Fast gains update_plan (canonical roomote_runtime.plan transcript
  rows), request_user_input (canonical request/response events, session
  needs_input, authenticated response + hidden resume payload), and the
  setup-session-only launch_setup_starter_tasks tool with stable
  idempotency keys and Fast delegation linkage; setup completes on the
  first successful launch.
- AcpRequestUserInputQuestion gains backward-compatible selectionMode
  (single|multiple) and minSelections enforced by UI and server.
- New setup workspace: Fast transcript primary, trusted source-control
  side panel reusing existing provider components, drawer sheet on small
  screens, inline automation recommendations, OAuth-return milestones
  scheduled exactly once, and route transition to the same session.
- Setup funnel telemetry events and self-hosting docs update.
@roomote-community

roomote-community Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

4 issues outstanding. See task

  • apps/web/src/app/(onboarding)/setup/SetupConversationalSetup.tsx:59 passes the unified session ID to Fast-conversation APIs, so the setup transcript cannot load or accept replies.
  • apps/web/src/app/(onboarding)/setup/SetupConversationalSetup.tsx:34 does not refresh session status after creating the setup session, leaving the initial view stuck on preparation.
  • apps/web/src/app/(onboarding)/setup/SetupSourceControlPanel.tsx:100 keeps rendering the config stage after save, preventing access to the connect/sync stage.
  • apps/web/src/app/(onboarding)/setup/SetupSignedInFlow.tsx:215 bypasses the only analytics and product-update preference controls, so starter-task completion defaults self-hosted users into product updates.

Reviewed 9d71dd4

const notifyRecommendationChoice = useSetupRecommendationNotifications();

const messagesQuery = useQuery(
trpc.fastSessions.messages.queryOptions(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

sessionStatus returns setupSession.sessionId, but getOrCreateSetupSessionCommand stores that as the unified sessions.id. The fastSessions.* APIs called here look up fastAgentConversations.id, so the initial transcript request, replies, and structured-input submission all fail with "Fast session not found". Expose/use the linked fast-conversation ID for this surface and retain the unified ID only for /sessions/{id} routing.

saveSourceControlProviderChoice.mutate({ provider })
}
/>
) : stage === 'config' ? (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Saving configuration sets showConnectStage to true, but stage remains config because a selected provider is still present. This earlier branch always renders StepSourceControlConfig, so StepSourceControlConnect is unreachable and users cannot proceed to the OAuth/repository-sync step. Include showConnectStage in the stage calculation or test it before the config branch.

const statusQuery = useQuery(
trpc.setup.sessionStatus.queryOptions(undefined, { enabled }),
);
const createSession = useMutation(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The mutation result is discarded and sessionStatus is neither invalidated nor refetched. If its initial request observes no setup session (including the normal race where it completes before this mutation), sessionId remains null and the page stays on "Preparing your setup session..." until a reload. Use the returned session ID or invalidate/refetch setup.sessionStatus after success; also avoid reissuing creation while the mutation is pending.

…completion telemetry, and drop legacy wizard steps

- The conversational setup session's normal /sessions/{id} route now
  renders the inline automation-recommendations card (admin-gated), with
  Apply/Skip notifying Roomote so it can continue naturally.
- Task settlement records the 'first setup-launched task completed'
  funnel milestone exactly once (advisory-locked, anonymous properties)
  when a settled Fast child belongs to the setup session.
- Removes the communication-provider, automation-recommendations, and
  invoke steps from the signed-in setup flow per the conversational-first
  plan; compute-config completion hands off to the conversational gate.
  Persisted setup states are untouched and bootstrap keeps its auth
  provider components.
status.computeSetup.setupSatisfied &&
status.computeSetup.selectedProvider != null &&
status.setupCompletedAt == null;
if (conversationalSetupReady) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This handoff removes StepInvoke, the only UI that collected the anonymous-analytics and product-update preferences. The setup-session completion path still calls completeSetupCommand(auth) without input, so self-hosted users now lose the opt-out controls and are subscribed to product updates by the default when their first starter task launches. Preserve those preferences in the conversational flow and pass them to completion.

@mrubens mrubens closed this Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant