Worker briefs written by hand: the common openings count as well as the template's own line

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-23 16:37:20 -07:00
1 parent 66045a9ba1
commit dd291d1909
1 file changed
+5 -1
+5 -1
View File
@@ -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: