From dd291d1909ccdaa1f08259885b4796c5d6418825 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Mon, 23 Nov 2026 16:37:20 -0700 Subject: [PATCH] Worker briefs written by hand: the common openings count as well as the template's own line Co-Authored-By: Claude Fable 5.2 --- sisi/orchestration.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sisi/orchestration.py b/sisi/orchestration.py index 6600702..9876365 100644 --- a/sisi/orchestration.py +++ b/sisi/orchestration.py @@ -326,7 +326,11 @@ def new_turn(sid, cwd=None, prompt=None): # A host may put its own context in front of a child's first prompt, so the brief's opening line is # looked for near the top, not only at character zero. The session record is marked too: the contract # guard and the gate read `subagent` there, and a worker must be a worker on every path. - if m["prompts"] == 1 and any(ln.strip().lower().startswith(brief_line()) + # Briefs written by hand open in more than one way; these openings (the template's own line first) all + # tell the reader it is a worker. They count only when they start a line near the top of the first prompt. + openings = (brief_line(), "you are a worker", "you are a subagent", "you are a sub-agent", + "you are a delegate") + if m["prompts"] == 1 and any(ln.strip().lower().startswith(openings) for ln in text.lstrip()[:600].splitlines()): m["worker"] = True try: