scheduler/gateway: carry skill identity structurally, not in action_log
Skill bodies prefixed their own `category.name` into `ActionResult.action_log`, which duplicated the runner's deterministic summary prefix and leaked the name into the text the gateways speak. Identity is not data for the output string. - bodies (seeds, canned replies, housekeeping meta skills) write only the real result; the runner already owns the `category.name:` summary prefix - `run_queue`/`submit_request`/`answer` now return a structured `SchedulerReply` (status, text, run_id, skill_ref, result); the gateway reads `skill_ref` and `result` from it instead of regex-parsing them back out of the summary - drop the gateway's `_SKILL_REF`/`_LEADING_RUN_ID` parsing helpers - fix a latent double-prefix when a failed run had an empty action_log - CODEGEN.md: generated bodies must not prefix the skill name
This commit is contained in:
1 parent
d0c1dccffd
commit
e9a7fc73ee
22 files changed
+248
-200
No files matched your search
@@ -18,4 +18,4 @@ CONTRACT = {}
|
||||
def act(ctx, request):
|
||||
today = local_now(ctx.config).date()
|
||||
message = f"Today is {today.strftime('%A, %B %d, %Y')} ({today.isoformat()})."
|
||||
return ActionResult(action_log=f"time.date: {message}", new_state=message)
|
||||
return ActionResult(action_log=message, new_state=message)
|
||||
@@ -33,4 +33,4 @@ def act(ctx, request):
|
||||
f"It is {now.strftime('%H:%M')} "
|
||||
f"({now.strftime('%I:%M %p').lstrip('0')} {zone}{_offset_text(now)})."
|
||||
)
|
||||
return ActionResult(action_log=f"time.now: {message}", new_state=message)
|
||||
return ActionResult(action_log=message, new_state=message)
|
||||
@@ -71,17 +71,17 @@ def act(ctx, request):
|
||||
if when is None:
|
||||
request.meta["alarm_awaiting"] = True
|
||||
return ActionResult(
|
||||
action_log="time.set_alarm: waiting for a time",
|
||||
action_log="waiting for a time",
|
||||
new_state=request.text,
|
||||
needs_input="What time should the alarm go off? (e.g. '5pm')",
|
||||
)
|
||||
if ctx.timers is None:
|
||||
return ActionResult(
|
||||
action_log="time.set_alarm: no timer service is available in this front end",
|
||||
action_log="no timer service is available in this front end",
|
||||
new_state=request.text,
|
||||
)
|
||||
|
||||
label = when.strftime("%H:%M")
|
||||
ctx.timers.set_alarm(when, label, run_id=request.id, source=request.source)
|
||||
message = f"Alarm set for {when.strftime('%H:%M')} on {when.strftime('%A')}."
|
||||
return ActionResult(action_log=f"time.set_alarm: {message}", new_state=message)
|
||||
return ActionResult(action_log=message, new_state=message)
|
||||
@@ -111,13 +111,13 @@ def act(ctx, request):
|
||||
if seconds is None:
|
||||
request.meta["timer_awaiting"] = True
|
||||
return ActionResult(
|
||||
action_log="time.set_timer: waiting for a duration",
|
||||
action_log="waiting for a duration",
|
||||
new_state=request.text,
|
||||
needs_input="How long should the timer run? (e.g. '5 minutes')",
|
||||
)
|
||||
if ctx.timers is None:
|
||||
return ActionResult(
|
||||
action_log="time.set_timer: no timer service is available in this front end",
|
||||
action_log="no timer service is available in this front end",
|
||||
new_state=request.text,
|
||||
)
|
||||
|
||||
@@ -125,4 +125,4 @@ def act(ctx, request):
|
||||
timer = ctx.timers.set_timer(seconds, label, run_id=request.id, source=request.source)
|
||||
due = timer.due_datetime().strftime("%H:%M")
|
||||
message = f"Timer set for {label}; it will fire at {due}."
|
||||
return ActionResult(action_log=f"time.set_timer: {message}", new_state=message)
|
||||
return ActionResult(action_log=message, new_state=message)
|
||||
Reference in new issue
Block a user