Skip to content

Fresh self-hosted v1.2.3 setup loops on ChatGPT subscription inference failure #2195

Open

Description

@avinashkanaujiya

Summary

Fresh self-hosted Roomote v1.2.3 deployment cannot complete first-run setup with the documented ChatGPT subscription flow.

Environment

  • Roomote release: v1.2.3
  • Deployment: self-hosted Docker Compose
  • Host: Debian 13 x86_64
  • Public URL: custom HTTPS domain behind an existing reverse proxy
  • Inference choice: ChatGPT subscription

Steps to reproduce

  1. Start a fresh self-hosted deployment.
  2. Open the generated /setup URL.
  3. Create the first administrator with email and password.
  4. Connect/select ChatGPT subscription.
  5. Sign in and continue setup.

Expected behavior

Setup should produce a working conversational setup session and allow the first-run cards to continue.

Actual behavior

The application repeatedly redirects to the deterministic first-admin setup session. The setup conversation never produces a response and remains stuck retrying.

Observed server logs repeatedly report:

Inference attempt failed
resolvedModel="openai/gpt-5.6-sol"
reason="provider_error"
stage="opencode_setup" / "model_generation"
modelRequestCount=0

The failure occurs before a model request is sent. The containers remain healthy, but setup never progresses. Re-authenticating with the email/password account returns to the same setup session. The setup page's sign-up form also reports that the account already exists when trying to start over.

Additional observation

The UI exposes ChatGPT subscription as requiring no API key, but the self-hosted runtime internally initializes an OpenCode-based adapter. It is unclear whether the ChatGPT OAuth credential is expired/unusable, whether the adapter is missing required configuration, or whether v1.2.3 has a self-hosted regression. Please document the supported reconnect/recovery path and prevent an incomplete setup session from trapping the user in a retry loop.

No credentials, tokens, or private keys are included here.

Activity

  1. roomote-community commented on Sep 4, 2026

    @roomote-community
    Contributor

    I've analyzed this issue and here's my proposed implementation plan:

    The setup path currently treats a persisted ChatGPT OAuth connection as sufficient in saveSetupNewModelConfigCommand, while API-key and endpoint providers are validated through the restricted OpenCode runtime before setup advances. That allows the deterministic setup session to be created even when the ChatGPT credential or local OpenCode bootstrap cannot actually start a model request. Because getOrCreateSetupSessionCommand intentionally reuses setup:first-admin:<user>, signing in again returns to the same failed session rather than recovering it.

    1. Update apps/web/src/trpc/commands/setup-new/index.ts and the existing provider-validation path so ChatGPT subscription setup validates the selected openai/... model through the same control-plane OpenCode configuration used by the conversational setup session before persisting the provider as ready. Keep OAuth material server-side via packages/db/src/lib/chatgpt-subscription.ts and model-runtime-config.ts; distinguish expired/rejected authorization from a local OpenCode bootstrap failure.
    2. Refine pre-generation failure handling in packages/cloud-agents/src/server/non-task-provider-usage.ts and fast-agent/fast-agent-service.ts. Preserve modelRequestCount=0, but record the failing setup boundary (runtime config/auth resolution, server lease/readiness, session creation, event subscription, or prompt dispatch), classify credential failures as non-retryable, and stop automatically retrying configuration errors that cannot recover without operator action.
    3. Add a recoverable first-run state instead of trapping the admin in the deterministic session. In apps/web/src/app/(onboarding)/setup/SetupSignedInFlow.tsx, the authenticated setup guards, and apps/web/src/trpc/commands/setup/setup-session.ts, preserve the existing setup session and progress but route terminal inference/auth failures back to the inference-provider step with an actionable reconnect/retry message. After successful revalidation, resume the same session rather than creating a duplicate or requiring account recreation.
    4. Add regression coverage for fresh self-hosted setup, expired/rejected ChatGPT OAuth, OpenCode setup failure before the first model request, bounded retry behavior, provider revalidation, and deterministic session resumption. The main coverage belongs in setup-new command tests, SetupSignedInFlow/authenticated redirect tests, packages/db/src/lib/chatgpt-subscription.test.ts, model-runtime-config.test.ts, and the existing non-task inference and fast-agent diagnostics tests.
    5. Update apps/docs/providers/inference/chatgpt.mdx, apps/docs/use-chatgpt-subscription.mdx, and apps/docs/self-hosting.mdx with the supported first-run recovery path, how to reconnect an expired subscription, and how operators can distinguish provider authorization failures from a local OpenCode startup/configuration failure without exposing credentials.

    This approach prevents setup from being marked inference-ready until the exact runtime path is usable, converts unrecoverable retry loops into an operator action, and retains the idempotent setup session so recovery does not lose progress.

    Please tag @roomote if you'd like me to implement this, or reply with feedback on the plan.

  2. mrubens commented on Sep 4, 2026

    @mrubens
    Contributor

    Thanks @avinashkanaujiya we will take a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions