[Feat] Guide first-admin setup through a conversational setup session - #1823
[Feat] Guide first-admin setup through a conversational setup session#1823roomote-roomote[bot] wants to merge 3 commits into
Conversation
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.
|
4 issues outstanding. See task
Reviewed 9d71dd4 |
| const notifyRecommendationChoice = useSetupRecommendationNotifications(); | ||
|
|
||
| const messagesQuery = useQuery( | ||
| trpc.fastSessions.messages.queryOptions( |
There was a problem hiding this comment.
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' ? ( |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
Related issue
Implements the approved "Conversational First-Admin Setup" plan delivered via Roomote task 3frymp1tkofbq.
Why this PR exists
What changed
Once a first administrator's bootstrap is complete (authentication, inference, and a usable compute provider), the signed-in
/setupwizard is replaced by a persistent conversational setup session:setup.getOrCreateSessioncommand, 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 deploymentsetupNewStateJSON (optionalsetupSessionmetadata 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.update_planpersists canonicalroomote_runtime.plantranscript rows;request_user_inputpersists canonical request/response ACP events, ends the turn with the session inneeds_input, and resumes automatically from an authenticated response endpoint with a hidden normalized answer payload;launch_setup_starter_tasksis exposed only to the active setup session (enforced at both the tool filter and the native tool bridge), resolves prompts server-side fromSETUP_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.AcpRequestUserInputQuestiongains backward-compatibleselectionMode(singledefault,multiplewith checkboxes and an explicit Submit) andminSelections, enforced by both UI and server; sessions render a generalized structured-input card and deriveneeds_inputfrom unanswered transcript requests./setupnow 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.compute-configcompletion 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).How it was tested
@roomote/types), setup-only tool filtering and setup prompt guidance (@roomote/cloud-agents), real-database coverage for Fast pending-input resolution andneeds_inputderivation (@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).pnpm lint:fast,pnpm check-types:fast,pnpm knip, and the fullpnpm checksuite pass on this branch (the only failures in the sandbox run are two pre-existing@roomote/apiSlack-workflow test cases that also fail on cleanorigin/develophere, plus shared-test-DB pollution artifacts)./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
Checklist
[Feat] Guide first-admin setup through a conversational setup sessionpnpm lintandpnpm check-typespass locally (fullpnpm checkpasses)pnpm changeset