Skip to content

Commit 7c3b29b

Browse files
authored
Merge branch 'master' into master
2 parents 7907915 + cf61fbf commit 7c3b29b

File tree

4 files changed

+27
-9
lines changed

4 files changed

+27
-9
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## Unreleased
44

5+
## 0.44.1
6+
7+
- Fix renew token regression.
8+
- Improve error feedback when failed to renew token.
9+
510
## 0.44.0
611

712
- Support `deny` tool calls via `toolCall approval deny` setting.

resources/ECA_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.44.0
1+
0.44.1

src/eca/features/chat.clj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,12 @@
129129
(send-content! chat-ctx :system {:type :progress
130130
:state :running
131131
:text "Renewing auth token"})
132-
(f.login/renew-auth! provider db*)))
132+
(f.login/renew-auth! provider chat-ctx
133+
{:on-error (fn [error-msg]
134+
(send-content! chat-ctx :system {:type :text
135+
:text error-msg})
136+
(finish-chat-prompt! :idle chat-ctx)
137+
(throw (ex-info "Auth token renew failed" {})))})))
133138

134139
(send-content! chat-ctx :system {:type :progress
135140
:state :running

src/eca/features/login.clj

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,26 @@
4949
:content {:type :text
5050
:text (str input "\n")}})
5151
(login-step ctx)
52-
(db/update-global-cache! @db*)
5352
{:chat-id chat-id
5453
:status step}))
5554

56-
(defn renew-auth! [provider db*]
57-
(login-step
58-
{:provider provider
59-
:step :login/renew-token
60-
:db* db*})
61-
(db/update-global-cache! @db*))
55+
(defn renew-auth!
56+
[provider
57+
{:keys [db* messenger config]}
58+
{:keys [on-error]}]
59+
(try
60+
(login-step
61+
{:provider provider
62+
:messenger messenger
63+
:config config
64+
:step :login/renew-token
65+
:db* db*})
66+
(db/update-global-cache! @db*)
67+
(catch Exception e
68+
(on-error (.getMessage e)))))
6269

6370
(defn login-done! [{:keys [db* config messenger]}]
71+
(db/update-global-cache! @db*)
6472
(models/sync-models! db*
6573
config
6674
(fn [new-models]

0 commit comments

Comments
 (0)