@@ -273,14 +273,14 @@ func (b *bashTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error)
273273 },
274274 )
275275 if !p {
276− return NewTextErrorResponse("permission denied"), nil
276+ return ToolResponse{}, permission.ErrorPermissionDenied
277277 }
278278 }
279279 startTime := time.Now()
280280 shell := shell.GetPersistentShell(config.WorkingDirectory())
281281 stdout, stderr, exitCode, interrupted, err := shell.Exec(ctx, params.Command, params.Timeout)
282282 if err != nil {
283− return NewTextErrorResponse(fmt.Sprintf("error executing command: %s", err)), nil
283+ return ToolResponse{}, fmt.Errorf("error executing command: %w", err)
284284 }
285285 took := time.Since(startTime).Milliseconds()
286286