Skip to content

Smooth startup/provider-status warnings and slow request popups #15

Description

@badcuban

Priority: P1

User report

When first starting a chat, there is a "runtime warning" that does not explain what it is. It can take about 10 seconds to connect, and the chat window remains blank during that transition.

Follow-up observed on May 26, 2026:

  • During an active chat, BadCode showed Codex provider status with Timed out while checking Codex app-server provider status. even though the chat continued to work.
  • The global warning toast Some requests are slow / 1 request waiting longer than 15s. appeared during longer-running work.
  • The UI did not make it clear whether these were actionable failures, expected long-running provider/status checks, or background requests that should not interrupt the chat flow.

Why

First-run chat startup and in-session provider health warnings are critical trust moments. The UI should make it clear whether BadCode is connecting to the backend, starting a provider runtime, loading a project, waiting on a session, or merely seeing a non-blocking provider-status timeout. Slow-request warnings should be actionable and should not imply the active chat has failed when the provider is still handling turns.

Starting points

  • apps/web/src/components/WebSocketConnectionSurface.tsx handles WebSocket reconnect/offline surfaces and shows the Some requests are slow toast from slow RPC ack tracking.
  • apps/web/src/rpc/requestLatencyState.ts tracks requests waiting longer than the slow ack threshold.
  • apps/web/src/components/ChatView.tsx derives isWorking from phase, isSendBusy, and isConnecting.
  • apps/web/src/components/Sidebar.logic.ts has a Connecting thread status state.
  • Provider warning display paths include ProviderStatusBanner and provider status helpers.
  • apps/server/src/provider/Layers/CodexProvider.ts emits Timed out while checking Codex app-server provider status..
  • Server startup/readiness and provider startup events are under apps/server/src/serverRuntimeStartup.ts, apps/server/src/ws.ts, and provider service/runtime layers.

Acceptance criteria

  • First chat startup shows a clear non-blank loading/connecting state.
  • Runtime warnings include actionable text or link to diagnostics.
  • The UI distinguishes backend connection, provider startup, provider-status checks, and thread/session startup.
  • A Codex app-server provider-status timeout during an otherwise working chat is shown as stale/degraded status, not as a blocking chat failure.
  • Provider-status timeout messaging explains whether chat can continue and gives a clear retry/refresh affordance.
  • Long startup waits show progress or a retry/diagnostics affordance.
  • Slow-request popups identify the request area/method when possible, or link to diagnostics when details are available.
  • Slow-request popups are coalesced/dismissible and do not repeatedly distract during expected long-running chat/provider work.
  • Add regression coverage for first-load/first-thread connecting states, provider-status timeout display, and slow-request warning behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.enhancementRequested improvement or new capability.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions