fix: use model cache context flag for runtime context limits

This commit is contained in:
YeonGyu-Kim
2026-02-17 10:33:17 +09:00
parent b1e7bb4c59
commit b444899153
12 changed files with 94 additions and 39 deletions
+5 -1
View File
@@ -1,5 +1,6 @@
import type { HookName, OhMyOpenCodeConfig } from "../../config"
import type { PluginContext } from "../types"
import type { ModelCacheState } from "../../plugin-state"
import { createSessionHooks } from "./create-session-hooks"
import { createToolGuardHooks } from "./create-tool-guard-hooks"
@@ -8,14 +9,16 @@ import { createTransformHooks } from "./create-transform-hooks"
export function createCoreHooks(args: {
ctx: PluginContext
pluginConfig: OhMyOpenCodeConfig
modelCacheState: ModelCacheState
isHookEnabled: (hookName: HookName) => boolean
safeHookEnabled: boolean
}) {
const { ctx, pluginConfig, isHookEnabled, safeHookEnabled } = args
const { ctx, pluginConfig, modelCacheState, isHookEnabled, safeHookEnabled } = args
const session = createSessionHooks({
ctx,
pluginConfig,
modelCacheState,
isHookEnabled,
safeHookEnabled,
})
@@ -23,6 +26,7 @@ export function createCoreHooks(args: {
const tool = createToolGuardHooks({
ctx,
pluginConfig,
modelCacheState,
isHookEnabled,
safeHookEnabled,
})