MCPcopy Create free account
hub / github.com/cli/cli / afterSuccessfulTool

Function afterSuccessfulTool

evals/src/core/session.ts:4–16  ·  view source on GitHub ↗
(config: SessionConfig, action: () => Promise<void>)

Source from the content-addressed store, hash-verified

2
3/** Runs the actor before a successful tool result is released back to the agent. */
4export function afterSuccessfulTool(config: SessionConfig, action: () => Promise<void>): SessionConfig {
5 return {
6 ...config,
7 hooks: {
8 ...config.hooks,
9 async onPostToolUse(input, invocation) {
10 const output = await config.hooks?.onPostToolUse?.(input, invocation);
11 await action();
12 return output;
13 },
14 },
15 };
16}

Callers 2

createSessionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected