Edizzier
1f16bbf108
fix(cli): refuse to persist a truncated JSON reply as profile description
...
hermes_cli/profile_describer.py's aux-LLM response parser is documented as
"lenient, never raises": when the reply doesn't parse as JSON via
_extract_json_blob, it falls back to treating the WHOLE raw reply as plain
prose and persists it (truncated to 280 chars) as profile.yaml's
description.
That fallback exists for models that ignore the JSON-output instruction and
just answer in prose -- reasonable. But it doesn't distinguish that case
from a reply that DID start out as the requested JSON object and was cut
off mid-object by the aux model or transport. _extract_json_blob requires a
matching closing brace, so a truncated object (no `}` at all, or one cut
off mid-string) returns None just like plain prose does, and the fallback
then persists the raw JSON fragment verbatim: literal leading `{`, `\n`
escapes, a sentence chopped mid-word (#104067 ).
Fix: when parsing fails, check whether the reply (after the existing
code-fence strip) still looks JSON-shaped (starts with `{`). If so, it's a
malformed/truncated structured reply, not prose -- refuse it and return
ok=False instead of persisting the fragment. Only fall through to the
raw-text-as-prose fallback when the reply never looked like JSON to begin
with, so genuinely prose-only aux replies keep working exactly as before.
Also logs one INFO line on the refusal path, per the issue's note that the
silent fallback made this undiagnosable.
Update (review feedback from @jerrygooch): profile_describer._FENCE_RE was
case-sensitive, so an uppercase ```JSON fence wasn't stripped -- stripping
left "JSON\n{..." which doesn't start with "{", so a truncated response
under that fence variant still fell through to the prose fallback and got
persisted, defeating the fix for that case. Added re.IGNORECASE to
_FENCE_RE, aligning it with kanban_specify._FENCE_RE (which already used
re.IGNORECASE), and added a regression test for the uppercase-fence case.
Added tests/hermes_cli/test_profile_describer.py coverage: a truncated
object cut off mid-sentence (the real-world shape from the issue), one cut
off right after the opening brace, the same truncation under a ```json
fence, the same truncation under an uppercase ```JSON fence, and a
regression guard that a genuine plain-prose reply still hits the existing
lenient fallback unchanged.
Fixes #104067
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01LUtGTop5iGKi5vfWnKnwET
2026-09-06 05:34:01 -07:00
..
2026-09-04 00:15:16 -07:00
2026-08-12 18:52:08 -07:00
2026-09-04 00:15:16 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 03:31:03 -07:00
2026-09-04 01:28:31 -07:00
2026-09-04 20:24:24 -04:00
2026-09-02 22:51:30 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 15:07:39 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 15:07:39 -07:00
2026-09-03 02:46:19 -07:00
2026-09-02 20:23:43 -07:00
2026-09-03 13:05:57 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 21:00:34 -07:00
2026-09-04 02:12:35 -07:00
2026-09-03 13:49:57 -07:00
2026-09-02 20:56:23 -07:00
2026-09-03 13:49:57 -07:00
2026-09-05 18:08:00 +05:30
2026-09-02 22:51:30 -07:00
2026-09-03 13:08:40 -07:00
2026-09-04 04:37:08 -07:00
2026-09-02 22:51:19 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 13:08:40 -07:00
2026-09-03 13:48:49 -07:00
2026-09-03 13:48:49 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 13:08:40 -07:00
2026-09-02 21:59:38 -07:00
2026-09-03 13:08:40 -07:00
2026-09-02 21:59:38 -07:00
2026-09-05 17:43:45 +05:30
2026-09-02 20:34:28 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 02:07:33 -07:00
2026-09-03 13:29:35 -07:00
2026-09-02 21:26:16 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 23:58:31 -07:00
2026-09-02 23:58:31 -07:00
2026-09-03 17:13:22 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 13:05:57 -07:00
2026-09-03 13:05:57 -07:00
2026-09-02 21:14:52 -07:00
2026-09-03 13:49:57 -07:00
2026-09-03 15:43:04 -07:00
2026-09-05 12:21:28 +05:30
2026-09-05 12:21:28 +05:30
2026-09-03 09:44:26 -07:00
2026-09-03 14:00:59 -07:00
2026-09-02 21:23:44 -07:00
2026-09-05 12:21:28 +05:30
2026-09-03 09:44:26 -07:00
2026-09-03 15:43:04 -07:00
2026-09-02 22:42:56 -07:00
2026-09-03 17:00:26 -07:00
2026-09-03 13:30:31 -07:00
2026-09-02 23:58:31 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 21:03:13 -07:00
2026-09-02 15:03:42 -07:00
2026-09-03 14:00:59 -07:00
2026-09-03 17:00:26 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 00:06:54 -07:00
2026-09-05 21:00:19 +05:30
2026-09-03 14:00:59 -07:00
2026-09-03 14:00:59 -07:00
2026-09-05 21:00:19 +05:30
2026-09-03 17:13:22 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 20:47:14 -07:00
2026-09-03 03:31:03 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 13:05:57 -07:00
2026-09-03 00:02:56 -07:00
2026-09-05 16:45:59 +05:30
2026-09-03 15:07:39 -07:00
2026-09-03 00:04:40 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 14:16:54 -07:00
2026-09-03 00:06:30 -07:00
2026-09-04 00:15:16 -07:00
2026-09-04 01:28:31 -07:00
2026-09-03 13:16:47 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 13:29:35 -07:00
2026-09-03 00:05:41 -07:00
2026-09-03 13:46:50 -07:00
2026-09-05 19:01:22 +05:30
2026-09-04 01:28:31 -07:00
2026-09-04 07:17:00 -07:00
2026-09-05 17:01:23 +05:30
2026-09-03 09:44:26 -07:00
2026-09-02 21:20:42 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 20:40:51 -07:00
2026-09-03 09:44:26 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 00:06:30 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 20:06:17 -07:00
2026-09-03 00:06:30 -07:00
2026-09-02 21:20:42 -07:00
2026-09-03 00:06:30 -07:00
2026-09-03 00:10:28 -07:00
2026-09-03 14:00:59 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 13:48:14 -07:00
2026-09-03 13:48:14 -07:00
2026-09-03 13:48:14 -07:00
2026-09-03 13:48:14 -07:00
2026-09-03 13:48:14 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 13:48:14 -07:00
2026-09-02 20:34:04 -07:00
2026-09-03 13:48:14 -07:00
2026-09-03 13:48:14 -07:00
2026-09-02 21:17:47 -07:00
2026-09-03 13:48:14 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 20:12:36 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 20:15:37 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 15:07:39 -07:00
2026-09-03 15:07:39 -07:00
2026-09-03 15:07:39 -07:00
2026-09-03 15:07:39 -07:00
2026-09-03 13:33:47 -07:00
2026-09-03 15:07:39 -07:00
2026-09-03 15:07:39 -07:00
2026-09-03 15:07:39 -07:00
2026-09-06 14:53:33 +05:30
2026-09-02 21:44:59 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 21:21:25 -07:00
2026-09-03 13:29:35 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 13:29:35 -07:00
2026-09-02 21:44:59 -07:00
2026-09-02 20:50:08 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 21:44:59 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 20:51:30 -07:00
2026-09-02 20:51:30 -07:00
2026-09-03 03:31:03 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 20:51:30 -07:00
2026-09-02 20:51:30 -07:00
2026-09-02 21:54:56 -07:00
2026-09-02 21:54:56 -07:00
2026-09-03 15:07:39 -07:00
2026-09-03 15:07:39 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 14:00:59 -07:00
2026-09-04 00:15:16 -07:00
2026-09-05 06:20:45 -07:00
2026-09-03 14:00:59 -07:00
2026-09-03 13:48:49 -07:00
2026-09-03 13:48:49 -07:00
2026-09-03 13:48:49 -07:00
2026-09-04 00:15:16 -07:00
2026-09-02 22:14:17 -07:00
2026-09-02 21:57:34 -07:00
2026-09-03 17:13:22 -07:00
2026-09-04 07:17:00 -07:00
2026-09-03 09:44:26 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 20:40:15 -07:00
2026-09-02 20:24:29 -07:00
2026-09-02 20:40:15 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 20:19:57 -07:00
2026-09-02 21:57:39 -07:00
2026-09-04 04:56:11 -07:00
2026-09-03 14:00:59 -07:00
2026-09-02 21:10:03 -07:00
2026-09-03 09:44:26 -07:00
2026-09-04 01:28:31 -07:00
2026-09-03 00:09:39 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-04 01:28:31 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-04 01:48:47 -07:00
2026-09-02 21:49:24 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 15:07:39 -07:00
2026-09-06 05:34:01 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 00:06:57 -07:00
2026-09-03 13:46:50 -07:00
2026-09-02 21:07:16 -07:00
2026-09-02 21:07:16 -07:00
2026-09-02 22:55:15 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 21:09:53 -07:00
2026-09-02 21:00:55 -07:00
2026-09-03 09:44:26 -07:00
2026-09-04 20:24:24 -04:00
2026-09-04 20:24:24 -04:00
2026-09-02 21:00:55 -07:00
2026-09-02 20:47:24 -07:00
2026-09-02 21:00:55 -07:00
2026-09-02 22:39:49 -07:00
2026-09-03 14:00:59 -07:00
2026-09-03 14:00:59 -07:00
2026-09-04 00:15:16 -07:00
2026-09-02 22:25:24 -07:00
2026-09-03 14:00:59 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 21:07:16 -07:00
2026-09-02 21:07:16 -07:00
2026-09-02 22:33:08 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 00:06:57 -07:00
2026-09-03 00:06:57 -07:00
2026-09-03 00:06:57 -07:00
2026-09-03 00:06:57 -07:00
2026-09-03 00:06:57 -07:00
2026-09-03 03:31:03 -07:00
2026-09-02 23:59:27 -07:00
2026-09-03 13:46:50 -07:00
2026-09-02 23:42:50 -07:00
2026-09-03 13:05:57 -07:00
2026-09-02 22:39:06 -07:00
2026-09-03 13:33:10 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 15:07:39 -07:00
2026-09-04 07:17:00 -07:00
2026-09-03 13:33:10 -07:00
2026-09-03 13:33:10 -07:00
2026-09-03 00:11:01 -07:00
2026-09-04 00:15:16 -07:00
2026-09-02 20:43:25 -07:00
2026-09-03 13:08:40 -07:00
2026-09-03 13:22:48 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 22:55:43 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 23:04:20 -07:00
2026-09-02 20:59:41 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 09:44:26 -07:00
2026-09-04 07:17:00 -07:00
2026-09-04 00:15:16 -07:00
2026-09-02 20:43:25 -07:00
2026-09-02 21:36:24 -07:00
2026-09-02 21:34:25 -07:00
2026-09-03 22:00:01 -07:00
2026-09-02 21:49:33 -07:00
2026-09-02 20:43:25 -07:00
2026-09-02 15:03:42 -07:00
2026-09-02 20:43:25 -07:00
2026-09-02 23:04:20 -07:00
2026-09-03 13:22:51 -07:00
2026-09-03 13:29:35 -07:00
2026-09-03 14:16:54 -07:00
2026-09-03 13:10:38 -07:00
2026-09-05 12:21:28 +05:30
2026-09-02 20:38:18 -07:00
2026-09-02 21:31:17 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 16:34:55 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 14:27:29 -07:00
2026-09-06 14:53:33 +05:30
2026-09-03 09:44:26 -07:00
2026-09-05 00:24:40 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 21:49:26 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 21:45:19 -07:00
2026-09-06 14:53:33 +05:30
2026-09-02 22:12:58 -07:00
2026-09-02 21:28:23 -07:00
2026-09-02 21:28:23 -07:00
2026-09-02 21:28:23 -07:00
2026-09-03 13:20:22 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 14:21:32 -07:00
2026-09-04 20:24:24 -04:00
2026-09-03 14:37:14 -07:00
2026-09-03 14:21:32 -07:00
2026-09-05 16:30:35 +05:30
2026-09-03 14:21:32 -07:00
2026-09-03 14:21:32 -07:00
2026-09-05 20:44:51 +05:30
2026-09-04 20:24:51 -04:00
2026-09-03 14:21:32 -07:00
2026-09-03 14:21:32 -07:00
2026-09-03 14:21:32 -07:00
2026-09-03 14:21:32 -07:00
2026-09-03 14:21:32 -07:00
2026-09-03 14:21:32 -07:00
2026-09-05 20:44:51 +05:30
2026-09-04 00:15:16 -07:00
2026-09-04 20:24:24 -04:00
2026-09-02 23:08:44 -07:00
2026-09-02 23:08:44 -07:00
2026-09-03 13:05:57 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 21:54:36 -07:00
2026-09-02 23:08:44 -07:00