3228
try { parameters = JSON.parse(toolArgs) as Record<string, unknown>; } catch { /* ignore */ }
3229
}
3231
>
// commands so clients see the simplified form. Mirrors the logic in
3232
>
// mapSessionEvents (which handles the history-replay path).
3233
>
if (stripRedundantCdPrefix(e.data.toolName, parameters, this._workingDirectory)) {
3234
toolArgs = tryStringify(parameters);
3235
}
3237
>
if (this._shouldDropUnmappedSubagentEvent(e, 'tool.execution_start')) {
3238
return;
3239
}
3241
>
this._activeToolCalls.set(e.data.toolCallId, { toolName: e.data.toolName, displayName, parameters, content: [], parentToolCallId, mcpServerName: e.data.mcpServerName, meta: undefined });
3242
>
if (isShellTool(e.data.toolName)) {
3243
this._nonPtyShellTerminals.track(e.data.toolCallId, displayName);
3244
}
3246
const scope = parentToolCallId ?? '';
3247
this._currentTurn?.markdownPartIds.delete(scope);