Skip to content

Commit d1e00d2

Browse files
committed
Improve login messages for some providers
1 parent b36ead2 commit d1e00d2

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/eca/llm_providers/anthropic.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,14 +374,14 @@
374374
(swap! db* assoc-in [:auth provider] {:step :login/waiting-provider-code
375375
:mode :max
376376
:verifier verifier})
377-
(send-msg! (format "Open your browser at `%s` and authenticate at Anthropic.\nThen paste the code generated in the chat and send it to continue the authentication."
377+
(send-msg! (format "Open your browser at:\n\n%s\n\nAuthenticate at Anthropic, then paste the code generated in the chat and send it to continue the authentication."
378378
url)))
379379
"console"
380380
(let [{:keys [verifier url]} (oauth-url :console)]
381381
(swap! db* assoc-in [:auth provider] {:step :login/waiting-provider-code
382382
:mode :console
383383
:verifier verifier})
384-
(send-msg! (format "Open your browser at `%s` and authenticate at Anthropic.\nThen paste the code generated in the chat and send it to continue the authentication."
384+
(send-msg! (format "Open your browser at:\n\n%s\n\nAuthenticate at Anthropic, then paste the code generated in the chat and send it to continue the authentication."
385385
url)))
386386
"manual"
387387
(do

src/eca/llm_providers/copilot.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
(swap! db* assoc-in [:chats chat-id :login-provider] provider)
7272
(swap! db* assoc-in [:auth provider] {:step :login/waiting-user-confirmation
7373
:device-code device-code})
74-
(send-msg! (format "Open your browser at `%s` and authenticate using the code: `%s`\nThen type anything in the chat and send it to continue the authentication."
74+
(send-msg! (format "Open your browser at:\n\n%s\n\nAuthenticate using the code: `%s`\nThen type anything in the chat and send it to continue the authentication."
7575
url
7676
user-code))))
7777

src/eca/llm_providers/openai.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@
363363
:on-error (fn [error]
364364
(send-msg! (str "Error authenticating via oauth: " error))
365365
(oauth/stop-oauth-server! local-server-port))})
366-
(send-msg! (format "Open your browser at `%s` and authenticate at OpenAI.\n\nThen ECA will finish the login automatically." url)))
366+
(send-msg! (format "Open your browser at:\n\n%s\n\nAuthenticate at OpenAI, then ECA will finish the login automatically." url)))
367367
"manual"
368368
(do
369369
(swap! db* assoc-in [:auth provider] {:step :login/waiting-api-key

test/eca/features/login_test.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
:send-msg! send-msg!}))
5656

5757
(testing "should proceed to the next step"
58-
(is (re-find #"(?m)Open your browser at `https://mock.github.com/login/device` and authenticate using the code: `.+`\nThen type anything in the chat and send it to continue the authentication."
58+
(println @msg-log)
59+
(is (re-find #"(?m)Open your browser at:\n\nhttps://mock.github.com/login/device\n\nAuthenticate using the code: `.+`\nThen type anything in the chat and send it to continue the authentication."
5960
(last @msg-log)))
6061

6162
(testing "state is update to reflect in-progress login"

0 commit comments

Comments
 (0)