Commit 2afdb3c
fix(agent): say why the agent is unavailable instead of that it is
"the DeepSQL agent is unavailable right now" was returned for every failure,
and it reads as a transient outage — so the honest response is to wait, when
in fact nothing improves without someone changing a setting.
Two failures that need opposite fixes were indistinguishable: nothing is
listening (the runtime is down, or agent.webui-url points at a host that does
not exist), versus something answered and refused (it wants a login the backend
never performs). The log was no better: ensureSession logged e.getMessage(),
which is null for an unresolved host, producing "Could not create agent session
for profile u-admin: null".
Now the response names the target and the cause:
DeepSQL agent unavailable: cannot reach the agent runtime at
http://deepsql-agent:8787 — is it running, and is agent.webui-url correct?
DeepSQL agent unavailable: the agent runtime at http://127.0.0.1:8787
rejected the request: POST /api/session/new -> HTTP 401 {"detail":"Unauthorized"}
Both were observed against a live backend. The first corrected a misdiagnosis
made while investigating this very bug: the default agent.webui-url is the
Compose service name, so on a native run the backend never reaches the runtime
at all — which the old message had hidden behind "unavailable".
ensureSession keeps its signature; ensureSessionDetailed carries the reason, so
the Slack and dashboard callers are untouched.
Also:
* .env.example documents AGENT_WEBUI_URL, AGENT_PROVISIONER_URL and
AGENT_PROVISION_SECRET. None were listed, yet no non-Compose run works
without them, and their defaults are Compose hostnames.
* agent/distribution.yaml pins hermes_requires to <0.20.0. Upstream v0.20.0
(2026.8.3) answers 401 no_cookie to every agent API call: it requires a login
cookie, and AgentChatClient sends none — the Compose deployment relies on a
reverse proxy injecting X-DeepSQL-User / X-DeepSQL-Token. The floor stays at
0.12.0 deliberately; nothing below has been tested, and raising it would be a
guess presented as a fact.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 82b876b commit 2afdb3c
4 files changed
Lines changed: 97 additions & 10 deletions
File tree
- agent
- backend/src/main/java/com/dbaagent/service
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
141 | 162 | | |
142 | 163 | | |
143 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
10 | 20 | | |
11 | 21 | | |
12 | 22 | | |
| |||
Lines changed: 56 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
57 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
58 | 70 | | |
59 | | - | |
| 71 | + | |
60 | 72 | | |
61 | 73 | | |
62 | 74 | | |
| |||
66 | 78 | | |
67 | 79 | | |
68 | 80 | | |
69 | | - | |
| 81 | + | |
| 82 | + | |
70 | 83 | | |
71 | 84 | | |
72 | 85 | | |
73 | 86 | | |
74 | 87 | | |
75 | 88 | | |
76 | 89 | | |
77 | | - | |
| 90 | + | |
78 | 91 | | |
79 | | - | |
80 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
81 | 101 | | |
82 | 102 | | |
83 | 103 | | |
| |||
163 | 183 | | |
164 | 184 | | |
165 | 185 | | |
166 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
167 | 196 | | |
168 | 197 | | |
169 | 198 | | |
170 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
171 | 221 | | |
172 | 222 | | |
173 | 223 | | |
| |||
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
58 | 63 | | |
59 | | - | |
| 64 | + | |
60 | 65 | | |
| 66 | + | |
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
| |||
0 commit comments