mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-29 22:44:45 -07:00
Migrate beforeTool and afterTool hooks to hookSystem (#17204)
Co-authored-by: Ishaan Gupta <ishaankone@gmail.com> Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
This commit is contained in:
@@ -253,17 +253,7 @@ describe('ToolExecutor', () => {
|
||||
// 2. Mock executeToolWithHooks to trigger the PID callback
|
||||
const testPid = 12345;
|
||||
vi.mocked(coreToolHookTriggers.executeToolWithHooks).mockImplementation(
|
||||
async (
|
||||
_inv,
|
||||
_name,
|
||||
_sig,
|
||||
_bus,
|
||||
_hooks,
|
||||
_tool,
|
||||
_liveCb,
|
||||
_shellCfg,
|
||||
setPidCallback,
|
||||
) => {
|
||||
async (_inv, _name, _sig, _tool, _liveCb, _shellCfg, setPidCallback) => {
|
||||
// Simulate the shell tool reporting a PID
|
||||
if (setPidCallback) {
|
||||
setPidCallback(testPid);
|
||||
|
||||
@@ -66,8 +66,6 @@ export class ToolExecutor {
|
||||
: undefined;
|
||||
|
||||
const shellExecutionConfig = this.config.getShellExecutionConfig();
|
||||
const hooksEnabled = this.config.getEnableHooks();
|
||||
const messageBus = this.config.getMessageBus();
|
||||
|
||||
return runInDevTraceSpan(
|
||||
{
|
||||
@@ -95,8 +93,6 @@ export class ToolExecutor {
|
||||
invocation,
|
||||
toolName,
|
||||
signal,
|
||||
messageBus,
|
||||
hooksEnabled,
|
||||
tool,
|
||||
liveOutputCallback,
|
||||
shellExecutionConfig,
|
||||
@@ -108,8 +104,6 @@ export class ToolExecutor {
|
||||
invocation,
|
||||
toolName,
|
||||
signal,
|
||||
messageBus,
|
||||
hooksEnabled,
|
||||
tool,
|
||||
liveOutputCallback,
|
||||
shellExecutionConfig,
|
||||
|
||||
Reference in New Issue
Block a user