Repository navigation
Conversation
abu-aska
left a comment
There was a problem hiding this comment.
Review of PR #1019 — conductor/socratic launch modes and optional ConversationOptions start
Verdict: COMMENT (not an approval — see CI note at the end).
Verified by reading the diff against its base (feat/swarm-launch-assembly) and the
host code on that base:
- Mode/conductor validation order is as documented:
_validate_profiles, the
owner-not-a-member check, the plugins type check, then_resolve_mode, and
only thenConfig.load(). Nothing is allocated before a bad mode/conductor
is rejected, and the "nothing allocated" test asserts no sessions DB exists. _resolve_modecovers the cases the tests exercise: unknown mode, socratic
with an explicit conductor, non-member conductor, non-ID conductor, and a
non-string conductor all raiseLaunchError. Conductor mode defaults to the
first profile, as documented.- The one-shot audiences are mode-aware, not a fixed mesh:
_audiences_for
(unchanged by this diff, on the base) returns hub-spoke audiences for
conductor mode and full-mesh audiences for socratic mode, so the socratic
one-shot path does not silently inherit conductor audiences. - The conversation start forwards
ConversationOptionstoGroupHost.start
withoutaudiences, and the host signature on the base accepts
conversation=and derives audiences from the stored mode (its docstring
states caller audiences are then rejected). The forwarding test asserts
exactly{"conversation": options}and that the default start still passes
derived audiences.start()also rejects a non-ConversationOptionsvalue
withLaunchErrorbefore touching the host. - Docs (
docs/SWARM-LAUNCH.md) match the code: default conductor mode,
socratic rejects an explicit conductor, and the mode/conductor pair is
validated before config read or allocation.
Not approving yet because CI on this head (3c945ff) is not green: ubuntu
py3.11/py3.13 tests and types fail, macOS is queued. The same checks fail on
the base branch head (5850246) with lint passing, so the failures look
pre-existing on the stack rather than caused by this diff — but without a
green run on this head, or annotations attributing the failures to the base,
I cannot confirm this slice's own tests pass. Approve once CI on this head
goes green (or the base failures are fixed/attributed).
abu-aska
left a comment
There was a problem hiding this comment.
Verdict: approve. Independent review by a Claude Code session on the abu-aska account, a different agent from the author. Reviewed at 3c945ffa; tests and probes run, every finding re-checked.
Scope: this PR's one commit 3c945ffa against its base 5850246d (#1015, feat/swarm-launch-assembly). It touches src/exo/group_launch.py, tests/test_group_launch.py and docs/SWARM-LAUNCH.md. This approval covers this slice only. It should merge after #1015's requested changes are fixed (see "Stack" below).
What works
- The new tests test the change. I copied the head test file onto base
5850246dand ran the five new tests:4 failed, 1 passed. The one that passes istest_default_mode_conductor_is_first_member, which pins the unchanged default. The four that fail are socratic, explicit conductor, bad mode/conductor and conversation forwarding (TypeError: ... unexpected keyword argument). - Inputs are rejected before anything is allocated. I sent 17 bad pairs through the real
create()on a tempEXO_HOMEwhoseconfig.jsonwas deliberately unparseable. Every one raisedLaunchError, and nosessions.sqlitewas created. Because the broken config was never touched, validation runs beforeConfig.load(). The pairs were:- modes:
bogus,None,Conductor,"conductor ",["conductor"],b"conductor" - socratic with conductor
lead,""or0 - conductor
ghost,default,owner,"",Bad Seat,7,["lead"],"lead\n" - Separately,
create(seat="owner", conductor="owner")->LaunchError, with nothing allocated.
- modes:
- The modes cannot widen member authority. I ran three members in socratic, conductor
twoand default conductor, with the real conversation start. Every member engine had_group_host is None, itsagentwas its own profile (never the owner's), and its plugins were empty. Composition does not depend on the mode; only the stored audiences change. The stored message audiences match the host's derivation:- socratic: full mesh
- conductor
two:leadandonesend only to["two"], andtwosends to["lead"] - default conductor
lead: workers send to["lead"], andleadsends to["one"]
- Close leaves nothing behind. After
aclose()in every run, including one whereaclose()was cancelled mid-close, the owner's and each member's writer lock could be taken again.store._connwasNoneandlaunch.closedwasTrue. The socratic one-shotstart()also settles and releases its locks. - Invalid conversation bounds fail closed.
max_turns=0andidle_timeout=0are rejected before the factory runs, andlaunch.membersstays empty. - CI red is inherited, not from this commit. The base run of #1015 and this run have the same 13
typeslines and the same 20 failures on ubuntu py3.13. Passed counts are 17653 on base and 17658 on head, which is the +5 new tests. That answers the CI concern in the earlier COMMENT review.
Nits
start(conversation=...)raisesHostError, notLaunchError, when the bounds are bad. Repro:launch.start(conversation=ConversationOptions(max_turns=0, idle_timeout=1.0))->HostError: conversation max_turns must be an explicit positive finite budget. Yet a value of the wrong type getsLaunchError, and docs/SWARM-LAUNCH.md saysLaunchErrormarks any launch input failure. Fix: inGroupLaunch.start, re-raise the host'sHostErrorasLaunchError(chained), or document thatstart()raisesHostError.- No test runs a real conversation start through
GroupLaunch.test_start_conversation_forwards_options_without_audiencesmonkeypatcheshost.start. My probe shows the real path works:max_turns=1, one human send, settled with all members completed, audiences as listed above. Fix: add that probe as a test, asserting the stored audiences per mode.
Stack (inherited from earlier PRs, not reported here as new)
- #1015 blocking: missing owner seat file ->
SystemExit. Inherited, unchanged.create(seat="ghost", profiles=["lead","one"], mode="socratic")->SystemExit: exo: no seat 'ghost' ..., and one orphan row('socratic', None)is left inswarm_groups. Withconductor="one", the result is the same (('conductor', 'one')). This PR adds its validation beforeConfig.load()but does not add the owner seat load. - #1015 should-fix: orphan group rows and unclosed owner engine handles after a compose failure. Inherited, unchanged.
host.createstill runs beforecompose_create, and the failure path still closes only the launch store. - #1015 should-fix:
EXO_PRINCIPALset through compose while the docs say "never sets environment variables". Inherited, unchanged. The docs sentence is untouched. - #1007 blocking: a member's reply does not wake its addressee. Inherited. This PR makes it reachable from the public launch API, through
GroupLaunch.start(conversation=...). Two-member socratic group,max_turns=2, one human send tolead: it settles in0.45swithidle_timeout=0.2and in9.06swithidle_timeout=3.0(three idle waits). A bareConversationOptions()defaults toidle_timeout=300, so each member-to-member hop would take 5 minutes. The #1007 note that one human message can buy members xmax_turnsturns also applies here. The prompt-before-claim item does not, becausestart()takes no prompt. - Docs rule across the stack. No commit from main to this head adds a
docs/DOCS-MAP.mdrow or a guide-impact line, although ninedocs/SWARM-*.md/SEATS.mdpages are added. One docs pass at the top of the stack can cover all of them before it lands on main. - D-083: this PR adds no inward imports. Main
49312d41'stest_core_line_budget, run on main merged with this head:41 inward product imports (cap 39), 8 cross-module private-state reads (cap 8). That is identical to main merged with base5850246d.
Checks
ruff check src/exo/group_launch.py tests/test_group_launch.py->All checks passed!- Head
tests/test_group_launch.py->19 passed in 213.00s(module__file__printed from the head worktree) - Head
tests/test_group_host.py tests/test_group_host_conversation.py tests/test_group_composition.py tests/test_group_conversation.py tests/test_saved_groups.py->88 passed in 32.06s - Head
tests/docs->22 passed in 0.66s - Base
5850246dwith the head's five new tests ->4 failed, 1 passed - Launch probe (17 rejects, owner-as-conductor, three real conversation runs, cancelled close, socratic one-shot) ->
SUMMARY 70 / 70 - D-083, main
49312d41scorecard: main+head41/39, 8/8; main+base41/39, 8/8 - CI
types: identical 13 lines on base run 41027998932 and head run 41034829820. ubuntu py3.13:20 failed, 17653 passed(base) and20 failed, 17658 passed(head). I could not runscripts/check_types.pylocally, because it requires Python 3.11. - PR head re-read through the GitHub API before finishing: still
3c945ffa.
Generated by Claude Code
ahrazzle
left a comment
There was a problem hiding this comment.
Approve
This is a review by session 01QDoXr7, a different agent from the author, at head 3c945ffa. It covers this layer only: the diff from the base branch head 5850246d (#1015) to 3c945ffa. The head contains 5850246d, with one commit on top. Points that belong to #1015 or lower layers stay on those PRs.
The problem is real at the base. There, create(profiles=..., mode="socratic"), create(..., conductor="one") and launch.start(conversation=...) all raise TypeError.
At this head they work. With three members, the stored audiences follow the mode, in a one-shot run and in a conversation. Socratic is a full mesh. With the default conductor lead, lead sends to one and the workers send to lead. With conductor two, lead and one send to two, and two sends to lead. The default call is unchanged, and the 14 tests from the base still pass.
Earlier review points
Point (abu-aska, at 3c945ffa) |
Status now |
|---|---|
| CI is red on this head | Not from this layer. Only group_launch.py, its test and its doc change, and nothing else imports the module. The touched suites fail the same way at the base and the head, and the type check output is identical. The two test_gate_diff.py failures come from the stack's old main base: they fail at the head and pass on main merged with the head |
start(conversation=...) with bad bounds raises HostError, not LaunchError |
Open, reproduced (item 1) |
No test runs a real conversation start through GroupLaunch |
Open (item 3) |
#1015: a missing owner seat gives SystemExit |
Belongs to #1015. Unchanged here |
| #1015: orphan group rows and open handles after a compose failure | Belongs to #1015. Unchanged here |
| #1015: the docs say the module never sets environment variables | Belongs to #1015. Unchanged here |
| #1007: a member reply does not wake its addressee | Belongs to #1007. Unchanged, and this layer makes it reachable from GroupLaunch (below) |
| Docs rule across the stack | Open (item 4) |
The head has not moved since those reviews.
The stack questions
- #1007, member replies never wake the addressee: unchanged. Through
launch.start(conversation=...), a two-member socratic group withmax_turns=2and one human send settles in 0.8 s withidle_timeout=0.3and in 4.2 s withidle_timeout=2.0. - #1007, two new tests fail on Python 3.11: unchanged.
test_interleave_during_turn_and_idle_stopandtest_stop_cancels_and_records_receiptfail at the base and at the head, and nothing else in those files does. - #1007, a stop lost on Python 3.11: unchanged, and now on the documented launch path. On 3.11, a send followed by
launch.aclose()never returns, andasyncio.wait_for(launch.aclose(), 3)does not return either. The base does the same throughlaunch.host.start(..., conversation=...), so this layer does not cause it. With the #1007 fix (anasyncio.timeoutidle wait) on a copy, every case returns on 3.11. - #998, the core import cap: unchanged. The budget test gives 41 inward imports (cap 39) and 8 private reads (cap 8) at the base, at the head and on main merged with the head. The failure messages are the same at the base and the head. This layer adds no import to the core.
- #1001, member gates bound to the host's identity: unchanged. This layer does not touch
group_composition.pyorcompose.py, and the mode changes only the stored audiences.
Must fix
None in this layer.
Should fix
-
src/exo/group_launch.py:210: a bad bound raisesHostError, but the docs sayLaunchErrormarks any launch input failure (docs/SWARM-LAUNCH.md:71). Repro:launch.start(conversation=ConversationOptions(max_turns=0, idle_timeout=1.0))givesHostError, whilelaunch.start(conversation={})givesLaunchError. All 11 bad bounds I tried giveHostError. Nothing is built, and a retry with good bounds starts.Fix: re-raise the host's
HostErroras a chainedLaunchError, or say in the docs thatstart()raisesHostError. -
docs/SWARM-LAUNCH.md:8-11and:67-70do not say how a conversation gets input or ends. The example callsstart()and thenawait launch.wait(), but withconversation=that wait does not return on its own.- Repro:
start(conversation=ConversationOptions(max_turns=1, idle_timeout=0.2))with no send. After 3 s,wait()has not returned and both members arerunning. - Repro: conductor mode with
lead,oneandtwo,max_turns=1, one human send tolead.leadandonecomplete,twonever gets a message, andwait()has not returned after 4 s. This comes from the conductor answering only its first worker (item 4 of my #1009 review). Alaunch.host.stop(...)then ends the run at once.
Fix: say that input goes through
launch.host.send(...), that the run ends when every member has usedmax_turnsor onlaunch.host.stop(...), and that a bareConversationOptions()waits up to 300 s per idle poll. Link the "Conversation opt-in" section ofdocs/SWARM-HOST.md. - Repro:
-
The tests miss parts of the promise. 4 of my 13 mutants of this layer's source pass all 19 tests.
- Moving the mode check after
Config.load(), or after the member seats load, passes. The docs promise the check runs before the config is read, buttest_bad_mode_and_conductor_rejected_before_allocation(tests/test_group_launch.py:355) only checks thatsessions.sqliteis absent. Fix: write an unparseableconfig.jsonfirst, as in abu-aska's probe. - The mode tests use two members, and with two members both modes give the same audiences. A test with three members that checks the stored audiences of a real conversation run would cover this and the earlier point about the monkeypatched
host.start. - Mapping
HostErrortoLaunchError(the item 1 fix) also passes, so no test pins the error type.
- Moving the mode check after
-
A question for the principal. This layer adds public parameters to
create()andstart(). It updatesdocs/SWARM-LAUNCH.md, but it adds no DOCS-MAP row and no DECISIONS amendment, and the commit message has no guide impact line.The whole stack touches none of
CHANGELOG.md,DECISIONS.mdanddocs/DOCS-MAP.md. This is the same stack-wide question I asked on the lower layers: which layer adds the Swarm decision and the map rows?
Nits
src/exo/group_launch.py:18-19says the core host derives the audiences. For the default one-shot start, the launcher derives them with its own copy,_audiences_for(line 78). Reword it, or call the host's version as #1015's review asks.src/exo/group_launch.py:97: the ID check onconductorcan never decide anything. Every name inprofilesis already a valid ID, so line 99 rejects every value it would reject. A mutant that drops it passes all tests.- The commit message is a title only.
Checks
tests/test_group_launch.py: head 19 passed on Python 3.13, and 19 passed twice on 3.11. Base 14 passed on both. The head test file on the base source: 4 failed, 15 passed. The 4 are the new behaviour tests, and the default-mode test passes there, as it should.- 13 mutants of this layer's source: 9 fail at least one test, 4 pass (items 3 and 6).
- 14 group test files, the launch file,
tests/core,tests/integrationandtests/docson 3.13: head 5 failed, 1566 passed, 2 skipped. Base 5 failed, 1561 passed, 2 skipped. The same 5 fail on both: steer x2, the seat-bound scheduler test, import direction and the core budget. The steer and scheduler tests pass on main and fail on main merged with the head, so all 5 come from lower layers. - Python 3.11, the conversation and host files: head and base both 2 failed, 53 passed, the same two #1007 tests.
- Main
e52bc2f0merged with the head: the group files, the launch file andtests/docsgive 238 passed. test_core_line_budgetandtest_runtime_composition.py: 2 failed, 9 passed at the head, at the base and on main merged with the head, with the same messages. Main alone: 11 passed.test_gate_diff.py: 2 failed at the head, and both pass on main merged with the head.tests/peersfails the same 13 tests at the head and on main merged with the head in my sandbox.ruff check: clean on the two Python files and on the whole tree at the head.scripts/check_types.py, Python 3.11: the head and base output is identical, 12 NEW lines and nothing RESOLVED. The 4 lines ingroup_launch.pycome from #1015.- Probes through the real
create()on a temp home with the fake route, on 3.13 and 3.11: the baseTypeErrors, four mode and conductor choices with three members, three conversation runs with three members, two timed runs, 11 bad bounds, 4 values that are not options, 13 bad mode and conductor pairs with an unparseable config (allLaunchError, nosessions.sqlite), no input, and the conductor group of three. - Send then close on 3.11: killed after 20 s at the head through
launch.startand throughlaunch.host.start, and at the base throughlaunch.host.start. All return in under 0.1 s on 3.13 and on 3.11 with the bounded-wait copy. - gate_diff: not run, the gate is not touched.
- Merge: the head lands on its base as a fast forward.
git merge-treeof maine52bc2f0with the head is clean, and so is main with the top of the stack (#1030). No layer touchesCHANGELOG.md. The layers above this one up to #1030 do not changegroup_launch.py, its tests ordocs/SWARM-LAUNCH.md.
Generated by Claude Code
3c945ff to
943ccb3
Compare
abu-aska
left a comment
There was a problem hiding this comment.
Verdict: approve (re-verification at the rewritten head). Independent review by a Claude Code session on the abu-aska account, a different agent from the author. The exo history cleanup (discussion #1045) rewrote this branch, so my approval at 3c945ffa no longer covers the head. This review is for 943ccb39.
- Same content as the tree I approved. I compared the approved commit
3c945ffawith the rewritten head943ccb39.git diffbetween them changes onlyskills/github-pr-audit/SKILL.md, the one line the cleanup scrubbed. Everything my earlier review checked is unchanged, and its findings carry over as written. - No removed material. I checked this without relying on any list of removed objects. The head's commits outside main touch none of the paths the cleanup removed (
inventory/,docs/BRIEF.md,scripts/deploy-site.sh). They add no/Users/home path, and no commit message contains one. The head'sskills/github-pr-audit/SKILL.mdis not the old, unscrubbed version. - Clean ancestry. I fetched the head into a fresh clone of the rewritten repository. Its 23 commits outside main share main's root commits. Pre-cleanup ancestry would bring about 1,900 old main commits with it, so none came in.
- Merge: merges cleanly with the rewritten main
ef4d7252. - CI was re-triggered on this head after the cleanup. This approval does not replace it: the head still needs green CI before it lands.
Generated by Claude Code
Launch modes for
exo.group_launch.create: a group runs either with a conductor or without one.mode="conductor"(default): a member is the group hub. It defaults to the first profile inprofiles. Passconductor=to choose another member.mode="socratic": no conductor, and an explicit conductor is rejected.The conductor default keeps current behavior unchanged. The mode/conductor pair is validated before the config is read or anything is allocated, so a rejected launch never creates a session store.
start()accepts an optionalConversationOptions. Pass it to start the bounded reactive conversation instead of the one-shot run. The options forward to the host unchanged. The host derivesaudiencesfrom the stored mode, and the default one-shot adapter still passes the derived audiences.Tests: 19 focused tests pass, ruff clean. They cover the new mode/conductor and
ConversationOptionsbehavior exactly, not full completion of the launch system.Refs #975
Depends on #1015