Fix create_skill wedge: short-circuit single-option navigation, never leave scheduler busy

An empty category produced a one-option SemIf leaf decision; the backend rejects
<2 options, the ValueError unwound past the current-process reset, and every
later request queued forever behind a phantom current. Navigation now
short-circuits empty trees/categories straight to the create branch (no SemIf
decision when there's nothing to choose), and the scheduler clears its current
process even when dispatch raises. Authoring generation is capped at 128 tokens.
This commit is contained in:
Denton Social
2026-09-23 23:41:38 -05:00
parent 225b4df959
commit e68c56dca4
4 changed files with 80 additions and 8 deletions
+9 -3
View File
@@ -152,8 +152,10 @@ class Scheduler:
if self.current is None:
weight, label = self._score(request)
self.current = Process(request=request, skill="(scheduling)", weight=weight)
outcome = self._dispatch(request)
self.current = None
try:
outcome = self._dispatch(request)
finally:
self.current = None
self.trace.append("ran", request.id, skill=outcome.skill, summary=outcome.summary)
return "running", f"[{label}] {outcome.summary}"
@@ -197,7 +199,11 @@ class Scheduler:
outcome = self._dispatch(request)
except EngineUnavailable as exc:
outcome = DispatchResult(kind="error", summary=f"engine unavailable: {exc}")
self.current = None
except Exception as exc:
self.trace.append("error", request.id, phase="dispatch", message=str(exc))
outcome = DispatchResult(kind="error", summary=f"dispatch failed: {exc}")
finally:
self.current = None
self.trace.append("ran", request.id, skill=outcome.skill, summary=outcome.summary)
results.append(("ran", f"[{request.id}] {outcome.summary}"))
return results