Skip to content

fix(desktop): align session health notice with send/rebind authority #1038

Closed

Description

@Astro-Han

Problem

After #1032 / #1035, the composer-adjacent session health notice only appears for a narrowed hard-only matrix. Its inputs still use a renderer-side proxy (defaultConnection exists && enabled) and historical lastTestStatus, which do not match the authoritative send/rebind path.

Concrete mismatches:

  1. Locked sessions — once a session has user messages, connectionLocked blocks silent rebind (ensureSessionCanSendOrRebind). The notice can stay hidden when a default looks ready, so the user only learns at send time.
  2. Default not actually ready — default may be enabled but missing secret / model / chat capability. The notice stays silent; send still fails via requireReadyConnection.
  3. Non-default ready connection — send/rebind can succeed by walking other connections when the default is unusable. The notice can still show a destructive missing/fake state.
  4. lastTestStatus semantics — needs_reauth / error surface as current health copy, while E4 locks that lastTestStatus must not gate send. Calling these “hard-blocks” overstates send failure; product intent for “actionable prompt vs silent” needs an explicit contract.

Desired outcome

  • Notice inputs answer: “will the next send fail for a recoverable connection/session reason, and where should the user go?”
  • Reuse existing readiness / rebind authority (or a single pure projection over the same facts), including connectionLocked and real connection readiness — not only exists && enabled.
  • Document lastTestStatus as either:
    • an intentional pre-send actionable prompt that does not claim send is blocked, or
    • out of the notice entirely (Settings remains the home).
  • Keep refactor(desktop): move session health feedback into the conversation flow #1032 layout wins: no header status cluster, no Running / event-stream recovery badges, no fake-backend banner, notice only on the conversation surface above the composer.

Acceptance criteria

  • Locked fake / missing-connection sessions with history show a notice even when a default connection is enabled.
  • Enabled-but-not-ready defaults do not suppress a notice when send will fail and no other ready connection can rebind.
  • When silent rebind can succeed via any ready connection, the notice stays absent.
  • lastTestStatus behavior is covered by an explicit contract test aligned with send-path E4.
  • No regression of refactor(desktop): move session health feedback into the conversation flow #1032 layout contracts (no status cluster; notice gated to sessions).

Out of scope

  • Restoring the chat header status cluster, Running badge, or event-stream recovery badge.
  • Changing the session lifecycle state machine, event-stream recovery polling, or persistence format.
  • Redesigning turn-level failed/blocked banners or permission prompts.

Related

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions