Le fallback automatique sur détection de mismatch de chip (ESP32/ESP32-S3) dans zeroclaw_hw_firmware_loop.sh peut masquer des dégradations répétées de connexion USB.
Quand le port USB est instable, on peut voir une erreur de mismatch ponctuelle puis passer en env alternatif, ce qui cache le vrai problème.
What changed
Ajoute une vérification de stabilité du port USB avant tout fallback:
signature de port (hwid|description|serial_number) échantillonnée plusieurs fois.
fallback refusé si la signature flappe.
Introduit des paramètres d'ajustement:
ZEROCLAW_CHIP_MISMATCH_FALLBACK (défaut: 1)
ZEROCLAW_USB_STABILITY_SAMPLES (défaut: 2)
ZEROCLAW_USB_STABILITY_DELAY (défaut: 1)
Message explicite si fallback bloqué pour faciliter le diagnostic de lien USB.
Acceptance
bash -n tools/ai/zeroclaw_hw_firmware_loop.sh
Le fallback continue de fonctionner avec un mismatch réel sur port stable.
Un port instable doit produire un arrêt net sans fallback caché, avec message d'alerte.
Scope
Scriptes d'orchestration only (tools/ai/zeroclaw_hw_firmware_loop.sh).
## Why
Le fallback automatique sur détection de mismatch de chip (ESP32/ESP32-S3) dans `zeroclaw_hw_firmware_loop.sh` peut masquer des dégradations répétées de connexion USB.
Quand le port USB est instable, on peut voir une erreur de mismatch ponctuelle puis passer en env alternatif, ce qui cache le vrai problème.
## What changed
- Ajoute une vérification de stabilité du port USB avant tout fallback:
- signature de port (`hwid|description|serial_number`) échantillonnée plusieurs fois.
- fallback refusé si la signature flappe.
- Introduit des paramètres d'ajustement:
- `ZEROCLAW_CHIP_MISMATCH_FALLBACK` (défaut: `1`)
- `ZEROCLAW_USB_STABILITY_SAMPLES` (défaut: `2`)
- `ZEROCLAW_USB_STABILITY_DELAY` (défaut: `1`)
- Message explicite si fallback bloqué pour faciliter le diagnostic de lien USB.
## Acceptance
- `bash -n tools/ai/zeroclaw_hw_firmware_loop.sh`
- Le fallback continue de fonctionner avec un mismatch réel sur port stable.
- Un port instable doit produire un arrêt net sans fallback caché, avec message d'alerte.
## Scope
Scriptes d'orchestration only (`tools/ai/zeroclaw_hw_firmware_loop.sh`).
Codex review (manual): PASS. Scope is strictement , avec garde anti-flapping USB avant fallback env. Shellcheck fix intégré, checks GREEN. Changement utile pour éviter d'occulter des instabilités USB/port par fallback automatique. Je recommande merge squash.
Codex review (manual): PASS. Scope is strictement , avec garde anti-flapping USB avant fallback env. Shellcheck fix intégré, checks GREEN. Changement utile pour éviter d'occulter des instabilités USB/port par fallback automatique. Je recommande merge squash.
Codex review manuel: PASS. Scope strictement le script zeroclaw_hw_firmware_loop.sh. Ajout d'un contrôle de stabilité port USB avant fallback, ce qui évite de masquer les instabilités série/chute de câble. Checks CI green. Recommandé pour merge (squash).
Codex review manuel: PASS. Scope strictement le script zeroclaw_hw_firmware_loop.sh. Ajout d'un contrôle de stabilité port USB avant fallback, ce qui évite de masquer les instabilités série/chute de câble. Checks CI green. Recommandé pour merge (squash).
chatgpt-codex-connector[bot]
(Migrated from github.com)
reviewed 2026-02-21 18:24:06 +00:00
chatgpt-codex-connector[bot]
(Migrated from github.com)
left a comment
Copy Link
Copy Source
💡 Codex Review
Here are some automated review suggestions for this pull request.
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
### 💡 Codex Review
Here are some automated review suggestions for this pull request.
**Reviewed commit:** `3ab3a6b5b2`
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
[Your team has set up Codex to review pull requests in this repo](http://chatgpt.com/codex/settings/general). Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
</details>
The stability guard never detects a failed probe because sig="$(serial_port_signature "$port" 2>/dev/null || true)" always exits successfully, so the if ! ...; then return 1 branch is effectively dead. When pio device list cannot return the target port (the exact unstable-USB case this patch targets), sig becomes empty for each sample and the function incorrectly reports the port as stable, allowing auto-fallback to proceed and masking link flapping.
Useful? React with 👍 / 👎.
**<sub><sub></sub></sub> Treat failed signature reads as unstable**
The stability guard never detects a failed probe because `sig="$(serial_port_signature "$port" 2>/dev/null || true)"` always exits successfully, so the `if ! ...; then return 1` branch is effectively dead. When `pio device list` cannot return the target port (the exact unstable-USB case this patch targets), `sig` becomes empty for each sample and the function incorrectly reports the port as stable, allowing auto-fallback to proceed and masking link flapping.
Useful? React with 👍 / 👎.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Why
Le fallback automatique sur détection de mismatch de chip (ESP32/ESP32-S3) dans
zeroclaw_hw_firmware_loop.shpeut masquer des dégradations répétées de connexion USB.Quand le port USB est instable, on peut voir une erreur de mismatch ponctuelle puis passer en env alternatif, ce qui cache le vrai problème.
What changed
hwid|description|serial_number) échantillonnée plusieurs fois.ZEROCLAW_CHIP_MISMATCH_FALLBACK(défaut:1)ZEROCLAW_USB_STABILITY_SAMPLES(défaut:2)ZEROCLAW_USB_STABILITY_DELAY(défaut:1)Acceptance
bash -n tools/ai/zeroclaw_hw_firmware_loop.shScope
Scriptes d'orchestration only (
tools/ai/zeroclaw_hw_firmware_loop.sh).Codex review (manual): PASS. Scope is strictement , avec garde anti-flapping USB avant fallback env. Shellcheck fix intégré, checks GREEN. Changement utile pour éviter d'occulter des instabilités USB/port par fallback automatique. Je recommande merge squash.
Codex review manuel: PASS. Scope strictement le script zeroclaw_hw_firmware_loop.sh. Ajout d'un contrôle de stabilité port USB avant fallback, ce qui évite de masquer les instabilités série/chute de câble. Checks CI green. Recommandé pour merge (squash).
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
3ab3a6b5b2ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
@@ -106,0 +155,4 @@return 1fi((i++))if (( i < samples )); thenThe stability guard never detects a failed probe because
sig="$(serial_port_signature "$port" 2>/dev/null || true)"always exits successfully, so theif ! ...; then return 1branch is effectively dead. Whenpio device listcannot return the target port (the exact unstable-USB case this patch targets),sigbecomes empty for each sample and the function incorrectly reports the port as stable, allowing auto-fallback to proceed and masking link flapping.Useful? React with 👍 / 👎.