Jluc
Juillet 31, 2026, 12:04
1
Dans la discussion, l’IA indique des taux d’humidité dans la cuisine où aucun capteur ou sonde n’est présent.
Réponse de l’IA à la question : « Humidité dans la maison »
L’humidité dans la maison est de 52,0 % dans le salon, 51,7 % dans la chambre 1, 52,2 % dans la chambre 3, 52,3 % dans la cuisine, 52,5 % dans la salle de bain, 52,7 % dans la gaine technique, 52,8 % sur le balcon nord et 52,9 % sur le balcon sud.
Moi aussi j’ai un petit soucis :
Tout est faux : à priori le get envoyé n’est pas bon
Merci pour vos retours, ça me permet d’itérer sur ces petits bugs tout bête
J’ai fais une PR corrective :
master ← claude/gladys-ai-agent-feedback-am8ux3
ouvert 07:57AM - 01 Aug 26 UTC
### Description
This PR adds age tracking to sensor readings exposed to the LLM… , helping it distinguish between live measurements and stale values from sensors that have stopped reporting (dead batteries, unplugged devices, etc.).
**Key changes:**
1. **New `formatAge()` function** in `formatValue.js` that calculates how long ago a sensor value was last updated, returning compact formats like `'12min'`, `'3h'`, or `'6d'`. Returns `null` when the timestamp is missing or invalid.
2. **Updated `formatValue()` function** to include an `age` field in its output alongside `value` and `unit`. This provides the LLM with temporal context for every sensor reading.
3. **Improved empty state handling** in `buildSchemas.js` for the `device.get-state` tool. When no devices match the query, the tool now explicitly tells the LLM "no device is configured" instead of returning an empty list, preventing the model from hallucinating plausible values.
4. **Updated AI chat prompt** to clarify that the LLM should only report values present in tool results and never infer or estimate missing data.
All existing tests have been updated to expect the new `age` field, and comprehensive new tests cover:
- Age calculation in minutes, hours, and days
- Fresh values (0min)
- Future-dated values (treated as fresh due to clock skew)
- Missing or invalid timestamps (null age)
- Stale sensor tracking
### Checklist
- [x] Tests pass: All unit tests updated and new tests added for age tracking functionality
- [x] Linter and prettier pass
- [x] No breaking changes: The `age` field is additive; existing code consuming `value` and `unit` continues to work
https://claude.ai/code/session_01YHsCQc8ttFMpWzZAaYSwwn
## Summary by CodeRabbit
- **New Features**
- Sensor readings now display how long ago they were recorded.
- Clear messages appear when no matching devices or measurements are found.
- AI responses identify missing sensors, account for stale readings, and disclose incomplete tool results.
- **Bug Fixes**
- Prevented empty or misleading device-state responses when no results are available.
- Improved handling of missing, invalid, future, and outdated measurement timestamps.