Skip to content

Commit 06fef97

Browse files
committed
clean up imports in git ai integration service
1 parent 07fcb7c commit 06fef97

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

extensions/cli/src/services/GitAiIntegrationService.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { getCurrentSession, getSessionFilePath } from "../session.js";
44
import { logger } from "../util/logger.js";
55

66
import { BaseService } from "./BaseService.js";
7-
8-
import { services } from "./index.js";
7+
import { serviceContainer } from "./ServiceContainer.js";
8+
import type { ModelServiceState } from "./types.js";
99

1010
interface GitAiHookInput {
1111
session_id: string;
@@ -124,10 +124,10 @@ export class GitAiIntegrationService extends BaseService<GitAiIntegrationService
124124
const session = getCurrentSession();
125125
const sessionFilePath = getSessionFilePath();
126126

127-
// Get current model from ModelService
128-
const modelState = services.model.getState();
129-
console.log("modelState", modelState);
130-
const modelName = modelState?.model?.model;
127+
// Get current model from ModelService via serviceContainer
128+
const modelState =
129+
serviceContainer.getSync<ModelServiceState>("model");
130+
const modelName = modelState?.value?.model?.model;
131131

132132
const hookInput: GitAiHookInput = {
133133
session_id: session.sessionId,
@@ -167,10 +167,10 @@ export class GitAiIntegrationService extends BaseService<GitAiIntegrationService
167167
const session = getCurrentSession();
168168
const sessionFilePath = getSessionFilePath();
169169

170-
// Get current model from ModelService
171-
const modelState = services.model.getState();
172-
console.log("modelState", modelState);
173-
const modelName = modelState?.model?.model;
170+
// Get current model from ModelService via serviceContainer
171+
const modelState =
172+
serviceContainer.getSync<ModelServiceState>("model");
173+
const modelName = modelState?.value?.model?.model;
174174

175175
const hookInput: GitAiHookInput = {
176176
session_id: session.sessionId,

0 commit comments

Comments
 (0)