@@ -39,12 +39,9 @@ import {
3939} from "./features/claude-code-agent-loader" ;
4040import { loadMcpConfigs } from "./features/claude-code-mcp-loader" ;
4141import {
42- setCurrentSession ,
4342 setMainSession ,
4443 getMainSessionID ,
45- getCurrentSessionTitle ,
4644} from "./features/claude-code-session-state" ;
47- import { updateTerminalTitle } from "./features/terminal" ;
4845import { builtinTools , createCallOmoAgent , createBackgroundTools , createLookAt , interactive_bash , getTmuxPath } from "./tools" ;
4946import { BackgroundManager } from "./features/background-agent" ;
5047import { createBuiltinMcps } from "./mcp" ;
@@ -252,8 +249,6 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
252249 ? createEmptyMessageSanitizerHook ( )
253250 : null ;
254251
255- updateTerminalTitle ( { sessionId : "main" } ) ;
256-
257252 const backgroundManager = new BackgroundManager ( ctx ) ;
258253
259254 const backgroundNotificationHook = isHookEnabled ( "background-notification" )
@@ -427,40 +422,13 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
427422 | undefined ;
428423 if ( ! sessionInfo ?. parentID ) {
429424 setMainSession ( sessionInfo ?. id ) ;
430- setCurrentSession ( sessionInfo ?. id , sessionInfo ?. title ) ;
431- updateTerminalTitle ( {
432- sessionId : sessionInfo ?. id || "main" ,
433- status : "idle" ,
434- directory : ctx . directory ,
435- sessionTitle : sessionInfo ?. title ,
436- } ) ;
437- }
438- }
439-
440- if ( event . type === "session.updated" ) {
441- const sessionInfo = props ?. info as
442- | { id ?: string ; title ?: string ; parentID ?: string }
443- | undefined ;
444- if ( ! sessionInfo ?. parentID ) {
445- setCurrentSession ( sessionInfo ?. id , sessionInfo ?. title ) ;
446- updateTerminalTitle ( {
447- sessionId : sessionInfo ?. id || "main" ,
448- status : "processing" ,
449- directory : ctx . directory ,
450- sessionTitle : sessionInfo ?. title ,
451- } ) ;
452425 }
453426 }
454427
455428 if ( event . type === "session.deleted" ) {
456429 const sessionInfo = props ?. info as { id ?: string } | undefined ;
457430 if ( sessionInfo ?. id === getMainSessionID ( ) ) {
458431 setMainSession ( undefined ) ;
459- setCurrentSession ( undefined , undefined ) ;
460- updateTerminalTitle ( {
461- sessionId : "main" ,
462- status : "idle" ,
463- } ) ;
464432 }
465433 }
466434
@@ -488,27 +456,6 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
488456 . catch ( ( ) => { } ) ;
489457 }
490458 }
491-
492- if ( sessionID && sessionID === getMainSessionID ( ) ) {
493- updateTerminalTitle ( {
494- sessionId : sessionID ,
495- status : "error" ,
496- directory : ctx . directory ,
497- sessionTitle : getCurrentSessionTitle ( ) ,
498- } ) ;
499- }
500- }
501-
502- if ( event . type === "session.idle" ) {
503- const sessionID = props ?. sessionID as string | undefined ;
504- if ( sessionID && sessionID === getMainSessionID ( ) ) {
505- updateTerminalTitle ( {
506- sessionId : sessionID ,
507- status : "idle" ,
508- directory : ctx . directory ,
509- sessionTitle : getCurrentSessionTitle ( ) ,
510- } ) ;
511- }
512459 }
513460 } ,
514461
@@ -528,16 +475,6 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
528475 ...( isExploreOrLibrarian ? { call_omo_agent : false } : { } ) ,
529476 } ;
530477 }
531-
532- if ( input . sessionID === getMainSessionID ( ) ) {
533- updateTerminalTitle ( {
534- sessionId : input . sessionID ,
535- status : "tool" ,
536- currentTool : input . tool ,
537- directory : ctx . directory ,
538- sessionTitle : getCurrentSessionTitle ( ) ,
539- } ) ;
540- }
541478 } ,
542479
543480 "tool.execute.after" : async ( input , output ) => {
@@ -551,15 +488,6 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
551488 await emptyTaskResponseDetector ?. [ "tool.execute.after" ] ( input , output ) ;
552489 await agentUsageReminder ?. [ "tool.execute.after" ] ( input , output ) ;
553490 await interactiveBashSession ?. [ "tool.execute.after" ] ( input , output ) ;
554-
555- if ( input . sessionID === getMainSessionID ( ) ) {
556- updateTerminalTitle ( {
557- sessionId : input . sessionID ,
558- status : "idle" ,
559- directory : ctx . directory ,
560- sessionTitle : getCurrentSessionTitle ( ) ,
561- } ) ;
562- }
563491 } ,
564492 } ;
565493} ;
0 commit comments