@@ -140,10 +140,6 @@ export default async function githubAppRoutes(fastify: FastifyInstance) {
140140 const req = request as AuthenticatedRequest ;
141141 const { available } = request . query as { available ?: string } ;
142142
143- // #region agent log
144- fetch ( 'http://127.0.0.1:7242/ingest/8d3b0573-4207-40dd-b592-63e02b65dcc5' , { method :'POST' , headers :{ 'Content-Type' :'application/json' } , body :JSON . stringify ( { location :'github-app.ts:GET /github/repos' , message :'Endpoint called' , data :{ userId :req . userId , available} , timestamp :Date . now ( ) , sessionId :'debug-session' , hypothesisId :'A' } ) } ) . catch ( ( ) => { } ) ;
145- // #endregion
146-
147143 try {
148144 // Get user's Octokit instance
149145 const octokit = await getUserOctokit ( req . userId , db ) ;
@@ -158,11 +154,6 @@ export default async function githubAppRoutes(fastify: FastifyInstance) {
158154 // If available=true, return all GitHub repos (for onboarding/selection)
159155 if ( available === 'true' ) {
160156 const githubRepos = await fetchUserRepos ( octokit as any ) ;
161-
162- // #region agent log
163- fetch ( 'http://127.0.0.1:7242/ingest/8d3b0573-4207-40dd-b592-63e02b65dcc5' , { method :'POST' , headers :{ 'Content-Type' :'application/json' } , body :JSON . stringify ( { location :'github-app.ts:GET /github/repos' , message :'Returning available GitHub repos' , data :{ count :githubRepos . length } , timestamp :Date . now ( ) , sessionId :'debug-session' , hypothesisId :'A' } ) } ) . catch ( ( ) => { } ) ;
164- // #endregion
165-
166157 return reply . send ( { repos : githubRepos } ) ;
167158 }
168159
@@ -174,10 +165,6 @@ export default async function githubAppRoutes(fastify: FastifyInstance) {
174165 [ req . userId ]
175166 ) ;
176167
177- // #region agent log
178- fetch ( 'http://127.0.0.1:7242/ingest/8d3b0573-4207-40dd-b592-63e02b65dcc5' , { method :'POST' , headers :{ 'Content-Type' :'application/json' } , body :JSON . stringify ( { location :'github-app.ts:GET /github/repos' , message :'Database repos fetched' , data :{ count :dbResult . rows . length , repos :dbResult . rows . map ( ( r :any ) => ( { id :r . id , github_repo_id :r . github_repo_id , full_name :r . full_name } ) ) } , timestamp :Date . now ( ) , sessionId :'debug-session' , hypothesisId :'A' } ) } ) . catch ( ( ) => { } ) ;
179- // #endregion
180-
181168 // If user has connected repos, return them (with database UUIDs)
182169 if ( dbResult . rows . length > 0 ) {
183170 const repos = dbResult . rows . map ( ( row : any ) => ( {
@@ -191,18 +178,10 @@ export default async function githubAppRoutes(fastify: FastifyInstance) {
191178 last_analyzed_at : row . last_analyzed_at ,
192179 } ) ) ;
193180
194- // #region agent log
195- fetch ( 'http://127.0.0.1:7242/ingest/8d3b0573-4207-40dd-b592-63e02b65dcc5' , { method :'POST' , headers :{ 'Content-Type' :'application/json' } , body :JSON . stringify ( { location :'github-app.ts:GET /github/repos' , message :'Returning database repos' , data :{ repoIds :repos . map ( ( r :any ) => r . id ) } , timestamp :Date . now ( ) , sessionId :'debug-session' , hypothesisId :'A' } ) } ) . catch ( ( ) => { } ) ;
196- // #endregion
197-
198181 return reply . send ( { repos } ) ;
199182 }
200183
201184 // No connected repos - return error to trigger redirect to onboarding
202- // #region agent log
203- fetch ( 'http://127.0.0.1:7242/ingest/8d3b0573-4207-40dd-b592-63e02b65dcc5' , { method :'POST' , headers :{ 'Content-Type' :'application/json' } , body :JSON . stringify ( { location :'github-app.ts:GET /github/repos' , message :'No connected repos found' , data :{ userId :req . userId } , timestamp :Date . now ( ) , sessionId :'debug-session' , hypothesisId :'B' } ) } ) . catch ( ( ) => { } ) ;
204- // #endregion
205-
206185 return reply . status ( 404 ) . send ( {
207186 error : 'No repositories connected' ,
208187 message : 'No repositories connected. Please connect repositories first.' ,
0 commit comments