fix(semantic-scene): preserve page/intents when all widgets are dangling, drop dead exception-name set

- _with_known_widgets_only used to discard the entire SemanticScene
  (returning None) when filtering dangling-element-id widgets left an
  empty list, losing valid page/intents. Now returns a SemanticScene
  with widgets=[] instead, matching design.md's 'dropped, not a hard
  failure' intent.
- Removed _SDK_UNAVAILABLE_EXCEPTION_NAMES, dead code left over from an
  abandoned name-based exception-matching approach; the blanket except
  Exception already maps every SDK failure correctly.

openspec: semantic-scene capability, archived change semantic-scene-runtime
This commit is contained in:
2026-07-07 08:31:03 +08:00
parent 725bf4cd9c
commit ca5e300289
3 changed files with 6 additions and 13 deletions
-8
View File
@@ -7,14 +7,6 @@ from semantic.config import DEFAULT_MODEL
from semantic.models import SEMANTIC_SCENE_SCHEMA, SemanticScene
from semantic.prompts import ENRICHMENT_SYSTEM_PROMPT, scene_user_prompt
_SDK_UNAVAILABLE_EXCEPTION_NAMES = {
"APITimeoutError",
"APIConnectionError",
"RateLimitError",
"AuthenticationError",
"APIStatusError",
}
class EnrichmentUnavailable(Exception):
"""Internal signal for expected enrichment transport/response failures."""