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
@@ -140,11 +140,11 @@ def act(ctx, request):
|
||||
try:
|
||||
payload = _get(ctx, "/inbox")
|
||||
except BridgeError as exc:
|
||||
return ActionResult(action_log=f"simplex.next_message: {exc}", new_state=request.text)
|
||||
return ActionResult(action_log=str(exc), new_state=request.text)
|
||||
senders = _senders(payload.get("messages") or [])
|
||||
if not senders:
|
||||
return ActionResult(
|
||||
action_log="simplex.next_message: no unread SimpleX messages.",
|
||||
action_log="no unread SimpleX messages.",
|
||||
new_state="no unread SimpleX messages",
|
||||
)
|
||||
decisions = []
|
||||
@@ -155,14 +155,14 @@ def act(ctx, request):
|
||||
)
|
||||
except BridgeError as exc:
|
||||
return ActionResult(
|
||||
action_log=f"simplex.next_message failed reading {contact!r}: {exc}",
|
||||
action_log=f"failed reading {contact!r}: {exc}",
|
||||
new_state=request.text,
|
||||
decisions=decisions,
|
||||
)
|
||||
message = payload.get("message")
|
||||
if not message:
|
||||
return ActionResult(
|
||||
action_log=f"simplex.next_message: no unread message from {contact!r}.",
|
||||
action_log=f"no unread message from {contact!r}.",
|
||||
new_state="no unread SimpleX messages",
|
||||
decisions=decisions,
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user