Skip to content

πŸ™Œ OpenHands: AI-Driven Development

782 B
Raw Blame
import { useActiveConversation } from "#/hooks/query/use-active-conversation";
import { isRuntimeUnavailableSandboxStatus } from "#/utils/conversation-archive-status";

/**
 * Whether the active conversation's runtime is unavailable, so runtime-backed
 * affordances (chat input, git/panel toggles) are read-only. Covers both a
 * missing (non-resumable) sandbox and an errored one.
 *
 * This is the read-only gate, not the archive predicate: use
 * `isEffectivelyArchivedConversation` for the archived presentation (list
 * visibility, the "Archived" chip, the dimmed title, and the status dot).
 */
export function useIsArchivedConversation() {
  const { data: conversation } = useActiveConversation();
  return isRuntimeUnavailableSandboxStatus(conversation?.sandbox_status);
}