33 getChannelAgentProvider ,
44 getChannelModel ,
55 resolveChannelCwd ,
6- getWorkspaces ,
76 getEnabledAgentProviders ,
87 getOpenCodeModels ,
98 getCodexModels ,
@@ -20,17 +19,14 @@ import {
2019 setGitHubInfoForUser ,
2120 getUserGeneralSettings ,
2221 setUserGeneralSettings ,
23- invalidateOdeConfigCache ,
2422} from "@/config" ;
2523import { startServer as startOpenCodeServer } from "@/agents/opencode" ;
2624import { startServer as startCodexServer } from "@/agents/codex" ;
27- import { syncSlackWorkspace } from "@/core/web/local-settings" ;
2825
2926const SETTINGS_LAUNCH_ACTION = "open_settings_modal" ;
3027const SETTINGS_MODAL_ID = "settings_modal" ;
3128const GENERAL_SETTINGS_LAUNCH_ACTION = "open_general_settings_modal" ;
3229const GENERAL_SETTINGS_MODAL_ID = "general_settings_modal" ;
33- const GENERAL_SYNC_WORKSPACE_ACTION = "general_sync_workspace" ;
3430const GITHUB_LAUNCH_ACTION = "open_github_token_modal" ;
3531const GITHUB_MODAL_ID = "github_token_modal" ;
3632const GITHUB_TOKEN_BLOCK = "github_token" ;
@@ -516,18 +512,6 @@ function buildGeneralSettingsModal(params: {
516512 ?? autoUpdateOptions [ 0 ] ,
517513 } ,
518514 } ,
519- {
520- type : "actions" as const ,
521- elements : [
522- {
523- type : "button" as const ,
524- action_id : GENERAL_SYNC_WORKSPACE_ACTION ,
525- text : { type : "plain_text" as const , text : "Sync Workspace" } ,
526- style : "primary" as const ,
527- value : channelId ,
528- } ,
529- ] ,
530- } ,
531515 ] ,
532516 } ;
533517}
@@ -624,42 +608,6 @@ export function setupInteractiveHandlers(): void {
624608 } ) ;
625609 } ) ;
626610
627- slackApp . action ( GENERAL_SYNC_WORKSPACE_ACTION , async ( { ack, body, client } ) => {
628- await ack ( ) ;
629-
630- const actionBody = body as SlackActionBody ;
631-
632- const channelId = getActionChannelId ( actionBody )
633- ?? getActionViewMetadata ( actionBody )
634- ?? actionBody . channel ?. id ;
635- const userId = getActionUserId ( actionBody ) ;
636- if ( ! channelId || ! userId ) return ;
637-
638- const workspaces = getWorkspaces ( ) ;
639- const syncResults = await Promise . allSettled (
640- workspaces . map ( async ( workspace ) => syncSlackWorkspace ( workspace . id ) )
641- ) ;
642-
643- const successful = syncResults
644- . filter ( ( result ) : result is PromiseFulfilledResult < Awaited < ReturnType < typeof syncSlackWorkspace > > > => result . status === "fulfilled" )
645- . map ( ( result ) => result . value ) ;
646- const syncedWorkspaces = successful . length ;
647- const syncedChannels = successful . reduce ( ( sum , workspace ) => sum + ( workspace . channels ?? workspace . channelDetails . length ) , 0 ) ;
648- const failedWorkspaces = syncResults . length - syncedWorkspaces ;
649-
650- invalidateOdeConfigCache ( ) ;
651-
652- const message = failedWorkspaces > 0
653- ? `Synced ${ syncedWorkspaces } workspaces with ${ syncedChannels } channels in total. Failed to sync ${ failedWorkspaces } workspaces.`
654- : `Synced ${ syncedWorkspaces } workspaces with ${ syncedChannels } channels in total.` ;
655-
656- await client . chat . postEphemeral ( {
657- channel : channelId ,
658- user : userId ,
659- text : message ,
660- } ) ;
661- } ) ;
662-
663611 slackApp . action ( PROVIDER_ACTION , async ( { ack, body, client } ) => {
664612 await ack ( ) ;
665613
0 commit comments