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:
gabby committed 2026-10-07 00:30:37 +00:00
1 parent d0c1dccffd
commit e9a7fc73ee
22 files changed
+248 -200

No files matched your search

+12 -11
View File
@@ -176,7 +176,10 @@ def test_gateway_skill_config_disables_humanize():
service = build_service_with_store(
llm, {"humanize": {"enabled": True}, "simplex": {}}, store
)
service._reply("simplex", "c", "time.now: ok — 12:00", kind="result")
service._reply(
"simplex", "c", "time.now: ok — 12:00", kind="result",
skill_ref="time.now", result="12:00",
)
assert service.outbound["simplex"].get_nowait().text == "time.now: ok — 12:00"
assert llm.calls == []
@@ -190,7 +193,10 @@ def test_gateway_skill_config_enables_humanize_over_platform():
{"humanize": {"enabled": False}, "simplex": {"humanize": False}},
store,
)
service._reply("simplex", "c", "time.now: ok — 12:00", kind="result")
service._reply(
"simplex", "c", "time.now: ok — 12:00", kind="result",
skill_ref="time.now", result="12:00",
)
assert service.outbound["simplex"].get_nowait().text == "It is 12:00."
@@ -201,13 +207,8 @@ def test_gateway_skill_config_absent_falls_back_to_platform():
service = build_service_with_store(
llm, {"humanize": {"enabled": True}, "simplex": {}}, store
)
service._reply("simplex", "c", "time.now: ok — 12:00", kind="result")
service._reply(
"simplex", "c", "time.now: ok — 12:00", kind="result",
skill_ref="time.now", result="12:00",
)
assert service.outbound["simplex"].get_nowait().text == "It is 12:00."
def test_skill_ref_parses_summary_and_resumed_marker():
from semif_agent.gateway.service import _skill_ref
assert _skill_ref("time.now: ok — 12:00") == "time.now"
assert _skill_ref("[resumed] track.manual: ok — sent") == "track.manual"
assert _skill_ref("queued") is None