teapot-coding-agent 0.37.51 → 0.37.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/mcp-registry.js +41 -2
- package/package.json +1 -1
- package/public/assets/{index-CA5xdfJ8.js → index-C3WVn9PU.js} +5 -5
- package/public/assets/index-C3WVn9PU.js.map +1 -0
- package/public/assets/{index-BIbBKxvp.css → index-QdJYoEpR.css} +1 -1
- package/public/assets/{shiki-CVi9kYxk.js → shiki-DXrq3pmf.js} +2 -2
- package/public/assets/{shiki-CVi9kYxk.js.map → shiki-DXrq3pmf.js.map} +1 -1
- package/public/index.html +2 -2
- package/public/assets/index-CA5xdfJ8.js.map +0 -1
|
@@ -176,8 +176,31 @@ export class McpRegistry {
|
|
|
176
176
|
st.status = "disabled";
|
|
177
177
|
return st;
|
|
178
178
|
}
|
|
179
|
-
if (st.status === "connected" && st.connection)
|
|
180
|
-
|
|
179
|
+
if (st.status === "connected" && st.connection) {
|
|
180
|
+
/**
|
|
181
|
+
* A cached connection is not proof the server is still there.
|
|
182
|
+
*
|
|
183
|
+
* This used to return immediately, so a server that restarted kept `status: "connected"` with
|
|
184
|
+
* its OLD tool list while the transport underneath was dead. The UI's `test` button opened a
|
|
185
|
+
* FRESH connection (`testConfig`), so it reported success and the tools appeared — and the
|
|
186
|
+
* agent, going through this cached path, could not call any of them. Reported as "test をすると
|
|
187
|
+
* 接続に成功するのに、エージェントからは呼べない".
|
|
188
|
+
*
|
|
189
|
+
* A cheap liveness probe settles it: a server that answers is reused, one that does not is
|
|
190
|
+
* dropped so the reconnect below builds a new transport. `tools()` is the cheapest call that
|
|
191
|
+
* exercises the transport for real (unlike reading the cached list).
|
|
192
|
+
*/
|
|
193
|
+
try {
|
|
194
|
+
st.tools = await st.connection.tools();
|
|
195
|
+
st.lastChecked = Date.now();
|
|
196
|
+
return st;
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
st.connection = undefined;
|
|
200
|
+
st.tools = [];
|
|
201
|
+
st.status = "disconnected";
|
|
202
|
+
}
|
|
203
|
+
}
|
|
181
204
|
st.status = "connecting";
|
|
182
205
|
st.lastError = undefined;
|
|
183
206
|
const auth = await this.authFor(name);
|
|
@@ -254,6 +277,22 @@ export class McpRegistry {
|
|
|
254
277
|
return { ok: r.ok, text: r.text };
|
|
255
278
|
}
|
|
256
279
|
catch (err) {
|
|
280
|
+
/**
|
|
281
|
+
* A failed call means the transport is suspect, not just this one call.
|
|
282
|
+
*
|
|
283
|
+
* Leaving `status: "connected"` made the next attempt reuse the same dead connection, so one
|
|
284
|
+
* server restart broke every subsequent call until the process restarted. Dropping the
|
|
285
|
+
* connection here lets `connect()` rebuild it on the next attempt — and the tools list is
|
|
286
|
+
* cleared with it, because a stale list is what let the UI show tools that could not be called.
|
|
287
|
+
*/
|
|
288
|
+
const st = this.servers.get(parts.server);
|
|
289
|
+
if (st) {
|
|
290
|
+
st.connection = undefined;
|
|
291
|
+
st.tools = [];
|
|
292
|
+
st.status = "disconnected";
|
|
293
|
+
st.lastError = err.message;
|
|
294
|
+
st.lastChecked = Date.now();
|
|
295
|
+
}
|
|
257
296
|
return { ok: false, text: `MCP call failed: ${err.message}` };
|
|
258
297
|
}
|
|
259
298
|
}
|