@@ -695,6 +695,7 @@ const EXPECTED_METHODS: &[&str] = &[
695695 "Diagnose" ,
696696 "RunConnectionSync" ,
697697 "RunSourceSync" ,
698+ "BootstrapConnection" ,
698699 "SourceSyncState" ,
699700 "SyncAuditLog" ,
700701 "EstimateSyncCostUsd" ,
@@ -1671,3 +1672,46 @@ async fn portability_and_lifecycle_round_trip(bus: &tinybus::Proxy) {
16711672 . expect ( "Shutdown timed out" )
16721673 . expect ( "Shutdown" ) ;
16731674}
1675+
1676+ #[ tokio:: test]
1677+ #[ ignore = "drives a real dlopen'ed module; must be the only such test in the process — see the module docs" ]
1678+ async fn bootstrap_connection_finds_its_provider_registry_inside_the_module ( ) {
1679+ // The Composio provider registry is a process-global that the *host's* boot
1680+ // used to fill. This module is a `cdylib` with its own statics, so unless
1681+ // its startup calls `init_default_providers` the registry here is empty —
1682+ // and `get_provider` answers `None` rather than erroring, so every
1683+ // `BootstrapConnection` would report "no composio provider registered" over
1684+ // a perfectly good connection. Nothing in a build, a type check or a unit
1685+ // test in the module's own workspace sees that, because they all run in a
1686+ // process the host has already initialised.
1687+ //
1688+ // So this asserts against the *loaded artifact*, and it asserts the
1689+ // distinction rather than the outcome. `Ok` means the provider resolved
1690+ // and its bootstrap ran; any other error means it resolved and the run
1691+ // failed on its own terms. Exactly one result says the registry was never
1692+ // populated, and that is the regression.
1693+ //
1694+ // An earlier revision required failure here, on the assumption that a temp
1695+ // workspace has no Composio — and the call succeeded, because the module's
1696+ // proxied `ComposioHost` answers through the test harness and the default
1697+ // bootstrap is content with that. Asserting the symptom instead of the
1698+ // mechanism made the test wrong about the one thing it exists to pin.
1699+ let workspace = tempfile:: tempdir ( ) . expect ( "tempdir" ) ;
1700+ let ( client, _host, _task) = admit_module ( workspace. path ( ) ) . await ;
1701+
1702+ let result: Result < ( ) , _ > = proxy ( & client)
1703+ . call (
1704+ "BootstrapConnection" ,
1705+ ( "gmail" . to_string ( ) , "conn-1" . to_string ( ) ) ,
1706+ )
1707+ . await ;
1708+
1709+ if let Err ( error) = result {
1710+ let rendered = format ! ( "{error:?}" ) ;
1711+ assert ! (
1712+ !rendered. contains( "no composio provider registered" ) ,
1713+ "the module's provider registry is empty — its startup did not call \
1714+ init_default_providers. Error was: {rendered}"
1715+ ) ;
1716+ }
1717+ }
0 commit comments