Fix tests for sessionManager/modelRegistry on context

- compaction-hooks-example.test.ts: get sessionManager/modelRegistry from ctx
- compaction-hooks.test.ts:
  - Pass sessionManager/modelRegistry to HookRunner constructor
  - Remove setSessionFile call
  - Update tests to use session.sessionManager instead of event.sessionManager
This commit is contained in:
Mario Zechner 2025-12-27 02:46:52 +01:00
parent 29fec7848e
commit 5fee9005b7
4 changed files with 18 additions and 11 deletions

View file

@ -298,7 +298,8 @@ export async function loadCustomTools(
// Shared API object - all tools get the same instance
const sharedApi: ToolAPI = {
cwd,
exec: (command: string, args: string[], options?: ExecOptions) => execCommand(command, args, cwd, options),
exec: (command: string, args: string[], options?: ExecOptions) =>
execCommand(command, args, options?.cwd ?? cwd, options),
ui: createNoOpUIContext(),
hasUI: false,
};