@@ -25,19 +25,20 @@ use crate::API;
2525pub struct ForgeAPI < S , F > {
2626 services : Arc < S > ,
2727 infra : Arc < F > ,
28+ config : forge_config:: ForgeConfig ,
2829}
2930
3031impl < A , F > ForgeAPI < A , F > {
31- pub fn new ( services : Arc < A > , infra : Arc < F > ) -> Self {
32- Self { services, infra }
32+ pub fn new ( services : Arc < A > , infra : Arc < F > , config : forge_config :: ForgeConfig ) -> Self {
33+ Self { services, infra, config }
3334 }
3435
3536 /// Creates a ForgeApp instance with the current services
3637 fn app ( & self ) -> ForgeApp < A >
3738 where
3839 A : Services ,
3940 {
40- ForgeApp :: new ( self . services . clone ( ) )
41+ ForgeApp :: new ( self . services . clone ( ) , self . config . clone ( ) )
4142 }
4243}
4344
@@ -51,8 +52,8 @@ impl ForgeAPI<ForgeServices<ForgeRepo<ForgeInfra>>, ForgeRepo<ForgeInfra>> {
5152 pub fn init ( cwd : PathBuf , config : ForgeConfig , services_url : Url ) -> Self {
5253 let infra = Arc :: new ( ForgeInfra :: new ( cwd, config. clone ( ) , services_url) ) ;
5354 let repo = Arc :: new ( ForgeRepo :: new ( infra. clone ( ) , config. clone ( ) ) ) ;
54- let app = Arc :: new ( ForgeServices :: new ( repo. clone ( ) , config) ) ;
55- ForgeAPI :: new ( app, repo)
55+ let app = Arc :: new ( ForgeServices :: new ( repo. clone ( ) , config. clone ( ) ) ) ;
56+ ForgeAPI :: new ( app, repo, config )
5657 }
5758
5859 pub async fn get_skills_internal ( & self ) -> Result < Vec < Skill > > {
@@ -98,7 +99,7 @@ impl<A: Services, F: CommandInfra + EnvironmentInfra + SkillRepository + GrpcInf
9899 diff : Option < String > ,
99100 additional_context : Option < String > ,
100101 ) -> Result < forge_app:: CommitResult > {
101- let git_app = GitApp :: new ( self . services . clone ( ) ) ;
102+ let git_app = GitApp :: new ( self . services . clone ( ) , self . config . clone ( ) ) ;
102103 let result = git_app
103104 . commit_message ( max_diff_size, diff, additional_context)
104105 . await ?;
@@ -154,10 +155,6 @@ impl<A: Services, F: CommandInfra + EnvironmentInfra + SkillRepository + GrpcInf
154155 self . services . get_environment ( ) . clone ( )
155156 }
156157
157- fn get_config ( & self ) -> ForgeConfig {
158- self . services . get_config ( )
159- }
160-
161158 async fn conversation (
162159 & self ,
163160 conversation_id : & ConversationId ,
0 commit comments