@@ -94,6 +94,8 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
9494 enabled : pluginConfig . tmux ?. enabled ?? false ,
9595 layout : pluginConfig . tmux ?. layout ?? 'main-vertical' ,
9696 main_pane_size : pluginConfig . tmux ?. main_pane_size ?? 60 ,
97+ main_pane_min_width : pluginConfig . tmux ?. main_pane_min_width ?? 120 ,
98+ agent_pane_min_width : pluginConfig . tmux ?. agent_pane_min_width ?? 40 ,
9799 } as const ;
98100 const isHookEnabled = ( hookName : HookName ) => ! disabledHooks . has ( hookName ) ;
99101
@@ -220,10 +222,30 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
220222
221223 const taskResumeInfo = createTaskResumeInfoHook ( ) ;
222224
223- const backgroundManager = new BackgroundManager ( ctx , pluginConfig . background_task ) ;
224-
225225 const tmuxSessionManager = new TmuxSessionManager ( ctx , tmuxConfig ) ;
226226
227+ const backgroundManager = new BackgroundManager ( ctx , pluginConfig . background_task , {
228+ tmuxConfig,
229+ onSubagentSessionCreated : async ( event ) => {
230+ log ( "[index] onSubagentSessionCreated callback received" , {
231+ sessionID : event . sessionID ,
232+ parentID : event . parentID ,
233+ title : event . title ,
234+ } ) ;
235+ await tmuxSessionManager . onSessionCreated ( {
236+ type : "session.created" ,
237+ properties : {
238+ info : {
239+ id : event . sessionID ,
240+ parentID : event . parentID ,
241+ title : event . title ,
242+ } ,
243+ } ,
244+ } ) ;
245+ log ( "[index] onSubagentSessionCreated callback completed" ) ;
246+ } ,
247+ } ) ;
248+
227249 const atlasHook = isHookEnabled ( "atlas" )
228250 ? createAtlasHook ( ctx , { directory : ctx . directory , backgroundManager } )
229251 : null ;
@@ -261,6 +283,23 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
261283 gitMasterConfig : pluginConfig . git_master ,
262284 sisyphusJuniorModel : pluginConfig . agents ?. [ "sisyphus-junior" ] ?. model ,
263285 browserProvider,
286+ onSyncSessionCreated : async ( event ) => {
287+ log ( "[index] onSyncSessionCreated callback" , {
288+ sessionID : event . sessionID ,
289+ parentID : event . parentID ,
290+ title : event . title ,
291+ } ) ;
292+ await tmuxSessionManager . onSessionCreated ( {
293+ type : "session.created" ,
294+ properties : {
295+ info : {
296+ id : event . sessionID ,
297+ parentID : event . parentID ,
298+ title : event . title ,
299+ } ,
300+ } ,
301+ } ) ;
302+ } ,
264303 } ) ;
265304 const disabledSkills = new Set ( pluginConfig . disabled_skills ?? [ ] ) ;
266305 const systemMcpNames = getSystemMcpServerNames ( ) ;
@@ -445,17 +484,14 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
445484 const sessionInfo = props ?. info as
446485 | { id ?: string ; title ?: string ; parentID ?: string }
447486 | undefined ;
487+ log ( "[event] session.created" , { sessionInfo, props } ) ;
448488 if ( ! sessionInfo ?. parentID ) {
449489 setMainSession ( sessionInfo ?. id ) ;
450490 }
451491 firstMessageVariantGate . markSessionCreated ( sessionInfo ) ;
452- if ( sessionInfo ?. id && sessionInfo ?. title ) {
453- await tmuxSessionManager . onSessionCreated ( {
454- sessionID : sessionInfo . id ,
455- parentID : sessionInfo . parentID ,
456- title : sessionInfo . title ,
457- } ) ;
458- }
492+ await tmuxSessionManager . onSessionCreated (
493+ event as { type : string ; properties ?: { info ?: { id ?: string ; parentID ?: string ; title ?: string } } }
494+ ) ;
459495 }
460496
461497 if ( event . type === "session.deleted" ) {
0 commit comments