Merge remote-tracking branch 'origin/main' into main

Resolve the navigate() leaf conflict: keep the local two-stage navigation
refactor (descriptions, confirm_category_fit, create_skill removed from the
leaf softmax) and apply origin's compose_state intent on top.

origin/main (857ad1a) was not runnable as pushed:
- compose_state renamed its param to additional_context but its body still
  read `current` (NameError) and _navigate_canned called it with a stray
  `additional_context:` annotation (SyntaxError).
- the rename was not propagated to scheduler.py's two callers (TypeError).

Resolution:
- compose_state(request, additional_context=None) renders `({additional_context})`.
- canned + navigate leaf decisions pass
  additional_context=f"all choices are within the {category} category".
- scheduler.py builds its state inline to keep the exact
  `[current process: …]` wording for the interrupt/priority decisions.
This commit is contained in:
gabby committed 2026-10-01 20:16:43 +00:00
commit da53e1eefc
3 files changed
+18 -10

No files matched your search

+15 -6
View File
@@ -471,10 +471,10 @@ def unresolved_variables(
return [name for name in (skill.contract or {}) if name not in merged]
def compose_state(request: Request, current: str | None = None) -> str:
def compose_state(request: Request, additional_context: str | None = None) -> str:
parts = [request.text]
if current:
parts.append(f"[current process: {current}]")
if additional_context:
parts.append(f"({additional_context})")
return " ".join(parts)
@@ -654,7 +654,10 @@ def _navigate_canned(
if len(ordered) == 1:
return ordered[0]
leaf = DecisionRequest(
state=compose_state(request, current=category),
state=compose_state(
request,
additional_context=f"all choices are within the {category} category",
),
question=(
"Which canned response best fits this input? "
f"Choose {ordered[-1].name} if none of the others does."
@@ -759,7 +762,10 @@ def navigate(
"skill_needed",
request.id,
category=category,
state=compose_state(request, current=category),
state=compose_state(
request,
additional_context=f"all choices are within the {category} category",
),
question="(this category has no skills yet)",
options=[],
selected="create_skill",
@@ -771,7 +777,10 @@ def navigate(
# guard, which owns the reuse-vs-create decision.
return skills[0]
leaf = DecisionRequest(
state=compose_state(request, current=category),
state=compose_state(
request,
additional_context=f"all choices are within the {category} category",
),
question=f"Which {category} skill performs the action this request asks for?",
options=[Option(s.name, s.description) for s in skills],
)