Repository navigation
Fix #2335: l3.abstraction hard-fails entire world-model generation on empty LLM title (no r - #2575
Open
syzsunshine219 wants to merge 2 commits into
Open
syzsunshine219 wants to merge 2 commits into
syzsunshine219 wants to merge 2 commits into
Conversation
…Tensor#2335) l3.abstraction previously threw LLM_OUTPUT_MALFORMED when the LLM returned an empty/whitespace `title`, aborting the entire world-model generation for the cluster. In production (v2.0.17) this turned a single flaky LLM response into a full pipeline failure. Soften the validator: keep the triple (environment / inference / constraints) as load-bearing but derive `title` from `domain_tags`, first environment label, or a static "Untitled world model" when the LLM leaves it empty. Emit `abstract.title_fallback` warn so ops still see the regression. Apply the same pattern to l2.induction — `title` is a display attribute while `trigger` and `procedure` remain load-bearing.
- Inline the raw-title check in l3.abstract (parity with l2.induce); drop the now-unused isEmptyString helper. - Add rawTitleType to the induce/abstract title_fallback warn logs so operators can distinguish null vs. "" vs. non-string LLM responses. - Route l2.induce.synthesiseTitle through sanitizeDerivedText + the shared truncate() helper so the fallback path matches the normal sanitised/ellipsised path. - Make l3.abstract's titleCaseTag and synthesiseTitle Unicode-safe by iterating over code points instead of UTF-16 code units, so emoji or surrogate-pair tags no longer corrupt the display title. - Drop the outdated docs/openspec/…-2335-….md pointer from the synthesiseTitle JSDoc — the referenced path never landed.
syzsunshine219
marked this pull request as ready for review
November 9, 2026 15:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restores the change proposed in #2338 for review against
mainafter its former base branch,dev-v2.0.33, was deleted. The source commits and authors are preserved.Source head:
ed61fb9928d9f1ac2b8ac159aaaea3c9a286cb2eThis PR is open for review. Review and CI against the current base are pending; validation claims in the original description below refer to the earlier snapshot. The original discussion and evidence remain in #2338.
Original change description
Description
Fixes issue #2335:
l3.abstractionno longer aborts a whole cluster's world-model generation when the LLM returns an emptytitle. Thevalidatecallback still requires the triple (environment/inference/constraints) but no longer throws on emptytitle;normaliseDraftsynthesises a fallback title fromdomain_tags(title-cased, joined with " · "), the first non-emptyenvironment[].label, or a static"Untitled world model".abstractDraftemits anabstract.title_fallbackwarn breadcrumb so ops can still spot LLM regressions.Applied the same softening to
l2.induction:titlebecomes a display attribute (falls back tosignatureLabel, else"Untitled policy") whiletriggerandprocedureremain load-bearing and still fail the draft when missing.Verified with vitest: the two focused test files run 16 tests (all passing) and the full
tests/unit/memory/l2 + l3suite runs 89 tests (all passing).tsc -p tsconfig.json --noEmitis clean. Changes touch four files underapps/memos-local-plugin/{core,tests}/memory/{l2,l3}; opsp task file and openspec change artefacts are staged in.ai-tasks/andopenspec/changes/for scheduler archival.Related Issue (Required): Fixes #2335
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Automated tests are pending.
Checklist
@whipser030,@hijzyplease review this PR.Reviewer Checklist