Repository navigation
Lead build step 1 follow-ups (T255) - #121
Merged
Merged
Conversation
… slots, SendMessage, TaskStop (T255) - H1: a child's events renew its lead's slot; a lead's slot never expires while a child slot is live. - H2: an agent's spawn of a sage: type meets the lead rules, the brief check and the slot in any mode. - M1: a lead's stop frees only its own slot; children keep theirs until their own stop or lease. - M2: an agent's SendMessage (not to main) is a spawn: only a lead, a full brief, a slot. - M3: only the main session's TaskStop frees a slot. - L1: the main session starts sage:lead only as lead-T<n> (name, else description). - L2: a failed exact spawn frees its slot; a pending slot with no start sign frees after 10 minutes. Closes #102 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… (T255) The chief chose option (c) for Q2: a message to a live child must not take a second slot, and the event cannot tell a stopped target from a live one. The hook now refuses an agent's SendMessage to anyone but main, in any mode, and says to start a fresh child or report to the sage. PostToolUseFailure no longer needs SendMessage. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ent (T255) A plain agent outside sage mode is the owner's normal Claude use. The SendMessage rule now has the scope of the nested spawn rule: sage mode on, or a sage: caller in any mode. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…any case (T255) - F-T255-7: the main session starts sage:lead only with run_in_background true, so the lead's slot binds at once and its children's events renew it. - F-T255-4: an agent never names a spawn "main" (any case, trimmed), in the name, or the description when there is no name. - F-T255-5: the sage type check is case-insensitive for the spawned type and the caller; the caller's lead check and the chief check stay exact-case. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 12, 2026
… agent (T255) A plain agent outside sage mode keeps its normal use, the same scope as the SendMessage rule. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…oles in any case (T255) - F-T255-10: in sage mode or from a sage agent, a spawn named lead-T<n> is refused like main (one reservedName function, one refusal sentence). - F-T255-12: the main session's TaskStop frees the named agent's slot, also an exact (lead or child) slot; an agent's TaskStop still frees nothing. - F-T255-13: the slot store compares roles in lower case, so a child that reports its type in another case keeps its slot through its events. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #102
The follow-ups to the lead build's step 1 (the nested spawn rules in the sage hook). No sage:lead agent exists yet, so none of these rules is live today.
Items and their tests (scripts/sage-hook.test.mjs)
Each test sends hook events to
handle()through the built hook. Each one fails on main (fb48e83) and passes on this branch.T255 H1: a child's events renew its lead's slot, and a lead with a running child keeps its slotsage:type meets the nested rules in any mode: only a lead starts it, only the five team roles, the brief check and a slot. The main session outside sage mode is unchanged.T255 H2: outside sage mode, an agent that is not a lead starts no sage agent; a lead keeps the brief checkT255 M1: a lead's stop does not free its running children's slotsmain: a message can wake a stopped agent outside every cap, and the event cannot tell a stopped target from a live one. The refusal says to start a fresh child or report to the sage. A plain agent outside sage mode, and the main session, are unchanged. This is the same scope as the nested spawn rule.T255 M2: a sage agent, or any agent in sage mode, sends SendMessage only to main; plain use outside sage mode is unchangedT255 M3: only the main session's TaskStop frees a slotsage:leadonly with the namelead-T<n>: the Agent tool'snamefield, ordescriptionwhen there is noname. The check that the task has a running lead run needs step 2; it is left to #118.T255 L1: the main session starts a lead only with the name lead-T<n>T255 L2: a spawn that never starts frees after 10 minutes, and a failed spawn frees at onceThe hook manifest (
claude.json) now sends SendMessage to the hook on PreToolUse. A new slot's time now comes from the hook's clock, not the file system's.Four old assertions changed, because they held the behaviour that M1 and L2 change. Lead spawns in the old tests now use the name
lead-T<n>.Repair round 1
Each test fails on the commit before the fix (351cfd3, the merge of main) and passes after it.
sage:leadonly withrun_in_background: true. A foreground lead's slot binds only when the lead ends, so its children's events could not renew it.F-T255-7: the main session starts a lead only in the backgroundmain(any letter case, after trimming): thenamefield, ordescriptionwhen there is noname. A plain agent outside sage mode keeps its normal use, the same scope as the SendMessage rule.F-T255-4: a sage agent, or any agent in sage mode, never names a spawn main; plain use outside sage mode is unchangedOURSis case-insensitive, and the spawned type is compared in lower case (the brief check, the lead name and background checks, the lead count, and the team list). The caller'ssage:leadcheck and the chief check stay exact-case: a case-insensitive match there would give lead or chief rights to another type.F-T255-5: a sage type in another letter case meets the same spawn and message rulesRepair round 2
Each test fails on 3b8c747 and passes after the fix.
lead-T<n>(trimmed, any case) is refused likemain. OnereservedNamefunction, one refusal sentence. The main session's own lead spawns are unchanged.F-T255-10: a sage agent, or any agent in sage mode, never names a spawn lead-T<n>; plain use outside sage mode is unchangedF-T255-12: the main session's TaskStop frees a lead's slot; an agent's TaskStop frees nonetakeandmatching), so a child that reportsSage:QAkeeps its slot through its events.F-T255-13: a child whose type comes in another letter case keeps its slot through its eventsNot verified live
tofield). The sage runs that check.nameordescription) the chief's Agent tool sends forlead-T<n>.lead-T<n>) frees its slot: the slot knows the agent id, not the name.🤖 Generated with Claude Code