@@ -1742,73 +1742,6 @@ fn surface_crash_loop_notifies_the_supervisor_over_the_bus() {
17421742 ) ;
17431743}
17441744
1745- /// The defect this test exists for: a child that names its parent by ADDRESS, where the migrated
1746- /// parent's immutable ID is different bytes from that address.
1747- ///
1748- /// The notifier resolves its recipient by exact ID. Before this fix, the raw authored reference
1749- /// was stored in the crash-loop record and handed straight to that ID lookup, which found nothing
1750- /// and logged a warning — so the supervisor of every address-referencing child silently never
1751- /// learned its child was crash-looping. Driving the real park path (`reconcile` + `execute` across
1752- /// passes with one cap) and then delivering the record end to end is what makes the regression
1753- /// fail on the old code: the record must already carry `0199…aaa`, not `org.root`.
1754- #[ test]
1755- fn a_crash_loop_reaches_a_supervisor_named_by_address_not_by_id ( ) {
1756- const PARENT_ID : & str = "0199b8f4-8d3a-7c21-9a44-6f85b7320aaa" ;
1757- let tmp = tempfile:: tempdir ( ) . unwrap ( ) ;
1758- write (
1759- tmp. path ( ) ,
1760- "agents/hetz/root/agent.kdl" ,
1761- & format ! (
1762- "agent \" root\" {{ id {PARENT_ID:?}; host \" hetz\" ; address \" org.root\" ; \
1763- pty \" agent\" {{ id \" hetz.root-seat\" ; command \" true\" }} }}\n "
1764- ) ,
1765- ) ;
1766- write (
1767- tmp. path ( ) ,
1768- "agents/hetz/demo/agent.toml" ,
1769- "identity=\" demo\" \n supervisor=\" org.root\" \n [restart]\n attempts=1\n interval=\" 60s\" \n mode=\" fail\" \n [pty.agent]\n id=\" hetz.demo-claude\" \n command=\" x\" \n " ,
1770- ) ;
1771- let found = discover ( tmp. path ( ) ) ;
1772- assert ! ( found. errors. is_empty( ) , "{:?}" , found. errors) ;
1773- let runner = FakeRunner {
1774- sessions : vec ! [ dead( "hetz.demo-claude" ) , live( "hetz.root-seat" ) ] ,
1775- ..Default :: default ( )
1776- } ;
1777- let mut cap = FlappingCap :: default ( ) ;
1778-
1779- let mut last = UpReport :: default ( ) ;
1780- for _ in 0 ..3 {
1781- let plan = reconcile ( & found. specs , & runner. sessions , "hetz" ) ;
1782- last = UpReport :: default ( ) ;
1783- execute ( & plan, & runner, & mut cap, & mut last) ;
1784- }
1785-
1786- assert_eq ! ( last. flapping, [ "hetz.demo-claude" ] ) ;
1787- assert_eq ! ( last. crash_loops. len( ) , 1 ) ;
1788- let cl = & last. crash_loops [ 0 ] ;
1789- assert_eq ! (
1790- cl. supervisor,
1791- SupervisorTarget :: Resolved ( PARENT_ID . to_owned( ) ) ,
1792- "the authored `org.root` address must be resolved to the parent's immutable ID before it \
1793- is stored, or the exact-ID notifier below drops the alert"
1794- ) ;
1795-
1796- surface_crash_loop ( tmp. path ( ) , "hetz" , cl) ;
1797-
1798- let inbox = message:: inbox_dir ( & tmp. path ( ) . join ( "agents/hetz/root" ) ) ;
1799- let msgs = message:: list_dir ( & inbox) . unwrap ( ) ;
1800- assert_eq ! (
1801- msgs. len( ) ,
1802- 1 ,
1803- "the supervisor named by address must still receive exactly one crash-loop notice"
1804- ) ;
1805- assert ! ( msgs[ 0 ] . tags. contains( & "crash-loop" . to_string( ) ) ) ;
1806- assert ! (
1807- msgs[ 0 ] . body. contains( "hetz.demo-claude" ) ,
1808- "the notice names the parked task: {}" ,
1809- msgs[ 0 ] . body
1810- ) ;
1811- }
18121745
18131746/// Equal bytes across the two namespaces must not let the wrong subject receive the alert.
18141747///
0 commit comments