Skip to content

[BUG] Allow use of local AI agent without loginΒ #380

@JeroenBoersma

Description

@JeroenBoersma

Bug Description

When using Atuin Desktop locally without login, it is still possible to setup ollama and enable AI features.
The AI assistant will become visible but will never open.

This is because login is mandatory to open the AI assistant.

https://github.com/atuinsh/desktop/blob/main/src/components/runbooks/editor/Editor.tsx#L288

Steps to Reproduce

  1. Open Settings / User, make sure to log-out
  2. Navigate to Settings / AI
  3. Enable AI features
  4. AI agent: Ollama
  5. Enable Ollama
  6. Set the right model
  7. Open a runbook
  8. Click the AI button
  9. Nothing happens

Expected Behavior

I expected that the AI button would work and open the chat.

Actual Behavior

The AI pop-up doesn't open.

Environment

  • OS: Ubuntu 24.04
  • Atuin Desktop Version: 0.2.20
  • Atuin CLI Version: 18.11.0
  • Shell: fish, bash, sh
  • Terminal: Ghostty

Screenshots/Logs

Image

Workaround

I cloned the project, build locally and this is my change, this works but I don't know if it is the expected behavior.

Better would be to get the provider so you could test that logged in only is required for atuinhub users.

Working solution

--- a/src/components/runbooks/editor/Editor.tsx
+++ b/src/components/runbooks/editor/Editor.tsx
@@ -81,6 +81,7 @@
 import useDocumentBridge from "@/lib/hooks/useDocumentBridge";
 import { ChargeTarget } from "@/rs-bindings/ChargeTarget";

+
 // Fix for react-dnd interference with BlockNote drag-and-drop
 // React-dnd wraps dataTransfer in a proxy that blocks access during drag operations
 // We capture the original data during dragstart and resynthesize clean drop events
@@ -279,13 +280,12 @@
   }, [owningOrgId]);

   // AI is enabled for logged-in Hub users when AI setting is on
-  const isLoggedIn = useStore((state) => state.isLoggedIn);
   const aiEnabled = useStore((state) => state.aiEnabled);
   const aiShareContext = useStore((state) => state.aiShareContext);
   const user = useStore((state) => state.user);
   const username = user?.username ?? "";
   const showAiHint = aiEnabled;
-  const aiEnabledState = isLoggedIn() && aiEnabled;
+  const aiEnabledState = aiEnabled;

   // AI panel width for resizable panel
   const aiPanelWidth = useStore((state) => state.aiPanelWidth);

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions