fix: reprise automatique de la session MCP du miroir après redémarrage (404)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGaEeUbVSdKNfpFRgWfCXa
This commit is contained in:
1 parent
303177a8f7
commit
4c9f0c55b5
2 files changed
+54
-1
No files matched your search
@@ -122,7 +122,9 @@ class MirrorClient:
|
||||
with urllib.request.urlopen(req, timeout=20) as resp:
|
||||
raw_body = resp.read().decode("utf-8")
|
||||
except urllib.error.HTTPError as e:
|
||||
if e.code == 400 and not self.session_id:
|
||||
# 404 = session MCP inconnue du miroir (redémarrage du miroir) : on en rouvre une et on rejoue l’appel une fois.
|
||||
if (e.code == 400 and not self.session_id) or e.code == 404:
|
||||
self.session_id = None
|
||||
self._initialize_session()
|
||||
req = urllib.request.Request(self.base_url, headers=self._get_headers(), data=data_bytes)
|
||||
with urllib.request.urlopen(req, timeout=20) as resp:
|
||||
|
||||
Reference in new issue
Block a user