Skip to content

Commit e144dd5

Browse files
committed
Merge branch 'remove-session-rename-hook'
2 parents 276b1ba + 8cdbd1c commit e144dd5

File tree

7 files changed

+0
-186
lines changed

7 files changed

+0
-186
lines changed

src/features/claude-code-session-state/detector.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
export * from "./types"
21
export * from "./state"
3-
export * from "./detector"
Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,11 @@
1-
import type { SessionErrorState, SessionInterruptState } from "./types"
2-
3-
export const sessionErrorState = new Map<string, SessionErrorState>()
4-
export const sessionInterruptState = new Map<string, SessionInterruptState>()
51
export const subagentSessions = new Set<string>()
6-
export const sessionFirstMessageProcessed = new Set<string>()
72

8-
export let currentSessionID: string | undefined
9-
export let currentSessionTitle: string | undefined
103
export let mainSessionID: string | undefined
114

12-
export function setCurrentSession(id: string | undefined, title: string | undefined) {
13-
currentSessionID = id
14-
currentSessionTitle = title
15-
}
16-
175
export function setMainSession(id: string | undefined) {
186
mainSessionID = id
197
}
208

21-
export function getCurrentSessionID(): string | undefined {
22-
return currentSessionID
23-
}
24-
25-
export function getCurrentSessionTitle(): string | undefined {
26-
return currentSessionTitle
27-
}
28-
299
export function getMainSessionID(): string | undefined {
3010
return mainSessionID
3111
}

src/features/claude-code-session-state/types.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/features/terminal/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/features/terminal/title.ts

Lines changed: 0 additions & 62 deletions
This file was deleted.

src/index.ts

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,9 @@ import {
3939
} from "./features/claude-code-agent-loader";
4040
import { loadMcpConfigs } from "./features/claude-code-mcp-loader";
4141
import {
42-
setCurrentSession,
4342
setMainSession,
4443
getMainSessionID,
45-
getCurrentSessionTitle,
4644
} from "./features/claude-code-session-state";
47-
import { updateTerminalTitle } from "./features/terminal";
4845
import { builtinTools, createCallOmoAgent, createBackgroundTools, createLookAt, interactive_bash, getTmuxPath } from "./tools";
4946
import { BackgroundManager } from "./features/background-agent";
5047
import { 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

Comments
 (0)